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

Unified Diff: lib/requestBlocker.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Handle webRequest.ResourceType (#5321) and RTCPeerConnection.generateCertificate, address comments Created June 15, 2017, 11:18 a.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
« inject.preload.js ('K') | « lib/csp.js ('k') | metadata.edge » ('j') | 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
@@ -29,9 +29,9 @@
const {port} = require("messaging");
const devtools = require("devtools");
-// Chrome can't distinguish between OBJECT_SUBREQUEST and OBJECT requests.
-if (!("OBJECT_SUBREQUEST" in chrome.webRequest.ResourceType))
Sebastian Noack 2017/06/19 11:07:02 This check was necessary to account for Firefox wh
Oleksandr 2017/06/21 23:38:35 This was just accidental reverting of a patch. Fix
- RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT;
+// Chrome and Firefox (WebExtensions) can't distinguish between
+// OBJECT_SUBREQUEST and OBJECT requests.
+RegExpFilter.typeMap.OBJECT_SUBREQUEST = RegExpFilter.typeMap.OBJECT;
// Map of content types reported by the browser to the respecitve content types
// used by Adblock Plus. Other content types are simply mapped to OTHER.
@@ -186,7 +186,10 @@
// 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).
- if (msg.requestType.toUpperCase() in chrome.webRequest.ResourceType)
+ // Edge supports neither webRequest.ResourceType nor WebSocket blocking yet:
+ // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10297376/
+ if (chrome.webRequest.ResourceType &&
+ (msg.requestType.toUpperCase() in chrome.webRequest.ResourceType))
return false;
return ext.webRequest.onBeforeRequest._dispatch(
« inject.preload.js ('K') | « lib/csp.js ('k') | metadata.edge » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld