Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -48,16 +48,23 @@ |
// Treat navigator.sendBeacon() the same as <a ping>, it's essentially the |
// same concept - merely generalized. |
yield ["beacon", "PING"]; |
// Treat <img srcset> and <picture> the same as other images. |
yield ["imageset", "IMAGE"]; |
}()); |
+// Expose supported resource types for devtools panel |
Jon Sonesen
2017/08/21 15:33:07
I think this comment could be improved but not sur
Sebastian Noack
2017/08/22 09:47:28
Yeah, I'd rather just remove that comment.
Jon Sonesen
2017/09/01 08:09:06
Acknowledged.
|
+exports.filterTypes = new Set(function*() |
+{ |
+ for (let type in chrome.webRequest.ResourceType) |
Sebastian Noack
2017/08/22 09:47:28
webRequest.ResourceType doesn't exist in Microsoft
Jon Sonesen
2017/09/01 08:09:06
Cool, can I just return if !(chrome.webRequest.Res
Sebastian Noack
2017/09/05 18:08:10
Yes, that will do.
|
+ yield resourceTypes.get(chrome.webRequest.ResourceType[type]) || "OTHER"; |
Sebastian Noack
2017/08/22 09:47:28
There are some filter types which we need to hard-
Jon Sonesen
2017/09/01 08:09:06
Cool, does it make sense to just add yields with e
Sebastian Noack
2017/09/05 18:08:10
Yes, I think this is the simplest approach.
|
+}()); |
+ |
function onBeforeRequestAsync(page, url, type, docDomain, |
thirdParty, sitekey, |
specificOnly, filter) |
{ |
if (filter) |
FilterNotifier.emit("filter.hitCount", filter, 0, 0, page); |
if (devtools) |