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

Unified Diff: lib/requestBlocker.js

Issue 29394585: Issue 5027 - Use updated webRequest API for WebSocket blocking (Closed)
Patch Set: Created March 24, 2017, 1 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 | « chrome/ext/background.js ('k') | metadata.chrome » ('j') | metadata.chrome » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/requestBlocker.js
===================================================================
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -149,15 +149,17 @@
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.websocket", (msg, sender) =>
{
+ if (ext.webRequest.hasOwnProperty("RequestType.WEBSOCKET"))
Sebastian Noack 2017/03/24 17:45:02 Does that even work? I think this should rather be
Jon Sonesen 2017/03/26 12:38:55 Thanks for pointing that out. I had tested this in
+ return;
Jon Sonesen 2017/03/24 13:04:43 This will cause connections created in shared work
Sebastian Noack 2017/03/24 17:45:02 Is that so? I'd rather assume that the code in lib
return ext.webRequest.onBeforeRequest._dispatch(
new URL(msg.url),
"WEBSOCKET",
sender.page,
sender.frame
).indexOf(false) != -1;
});
« no previous file with comments | « chrome/ext/background.js ('k') | metadata.chrome » ('j') | metadata.chrome » ('J')

Powered by Google App Engine
This is Rietveld