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: fixed logic at websocket wrapper Created March 27, 2017, 12:36 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/requestBlocker.js
===================================================================
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -147,17 +147,20 @@
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.websocket", (msg, sender) =>
+if (!("WEBSOCKET" in chrome.webRequest.ResourceType))
kzar 2017/03/28 05:38:13 Again please leave a comment here explaining that
Jon Sonesen 2017/03/28 13:03:14 No problem
{
- return ext.webRequest.onBeforeRequest._dispatch(
- new URL(msg.url),
- "WEBSOCKET",
- sender.page,
- sender.frame
- ).indexOf(false) != -1;
-});
+ port.on("request.websocket", (msg, sender) =>
+ {
+ return ext.webRequest.onBeforeRequest._dispatch(
+ new URL(msg.url),
+ "WEBSOCKET",
+ sender.page,
+ sender.frame
+ ).indexOf(false) != -1;
+ });
+}

Powered by Google App Engine
This is Rietveld