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

Unified Diff: lib/csp.js

Issue 29458601: Issue 5315 - Add support for Microsoft Edge (Closed)
Patch Set: Rebase to current tip Created July 27, 2017, 9:45 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
Index: lib/csp.js
===================================================================
--- a/lib/csp.js
+++ b/lib/csp.js
@@ -17,10 +17,12 @@
"use strict";
-// Before Chrome 58, the webRequest API did not intercept WebSocket
-// connections (see https://crbug.com/129353). Hence we inject CSP headers,
-// below, as a workaround.
-if (!("WEBSOCKET" in chrome.webRequest.ResourceType))
+// The webRequest API doesn't support WebSocket connection blocking in Microsoft
+// Edge and versions of Chrome before 58. Therefore for those we inject CSP
+// headers below as a workaround. See https://crbug.com/129353 and
+// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10297376/
+if (!chrome.webRequest.ResourceType ||
+ !("WEBSOCKET" in chrome.webRequest.ResourceType))
{
const {defaultMatcher} = require("matcher");
const {BlockingFilter, RegExpFilter} = require("filterClasses");

Powered by Google App Engine
This is Rietveld