Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/requestBlocker.js

Issue 29721716: Issue 6473 - Remove WebSocket wrapper (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Address comments to Patch Set 1 Created March 13, 2018, 6:04 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « inject.preload.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
});
« no previous file with comments | « inject.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld