Index: lib/requestBlocker.js |
=================================================================== |
--- a/lib/requestBlocker.js |
+++ b/lib/requestBlocker.js |
@@ -58,19 +58,18 @@ |
// Microsoft Edge does not have webRequest.ResourceType or the devtools panel. |
// Since filterTypes is only used by devtools, we can just bail out here. |
if (!(browser.webRequest.ResourceType)) |
return; |
for (let type in browser.webRequest.ResourceType) |
yield resourceTypes.get(browser.webRequest.ResourceType[type]) || "OTHER"; |
- // WEBSOCKET and WEBRTC get addressed through workarounds, even if the |
- // webRequest API is lacking support to block these kind of requests. |
- yield "WEBSOCKET"; |
+ // WEBRTC gets addressed through a workaround, even if the webRequest API is |
+ // lacking support to block this kind of a request. |
yield "WEBRTC"; |
// POPUP and ELEMHIDE filters aren't blocked on the request level but by other |
// means. They don't have a corresponding value in webRequest.ResourceType. |
yield "POPUP"; |
yield "ELEMHIDE"; |
}()); |
@@ -200,28 +199,17 @@ |
FilterNotifier.on("subscription.removed", onFilterChange); |
FilterNotifier.on("subscription.updated", onFilterChange); |
FilterNotifier.on("subscription.disabled", arg => onFilterChange(arg, true)); |
FilterNotifier.on("filter.added", onFilterChange); |
FilterNotifier.on("filter.removed", onFilterChange); |
FilterNotifier.on("filter.disabled", arg => onFilterChange(arg, true)); |
FilterNotifier.on("load", onFilterChange); |
-port.on("request.blockedByWrapper", (msg, sender) => |
+port.on("request.blockedByRTCWrapper", (msg, sender) => |
{ |
- // Chrome 58 onwards directly supports WebSocket blocking, so we can ignore |
- // messages from the wrapper here (see https://crbug.com/129353). Hopefully |
- // WebRTC will be supported soon too (see https://crbug.com/707683). |
- // Edge supports neither webRequest.ResourceType nor WebSocket blocking yet: |
- // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10297376/ |
- if (browser.webRequest.ResourceType && |
- (msg.requestType.toUpperCase() in browser.webRequest.ResourceType)) |
- { |
- return false; |
- } |
- |
return ext.webRequest.onBeforeRequest._dispatch( |
new URL(msg.url), |
- msg.requestType, |
+ "webrtc", |
sender.page, |
sender.frame |
).includes(false); |
}); |