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

Unified Diff: lib/requestBlocker.js

Issue 29347034: Issue 1727 - Prevent circumvention via WebSocket (Closed)
Patch Set: Try our best to prevent circumvention Created July 27, 2016, 12: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 | « include.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
diff --git a/lib/requestBlocker.js b/lib/requestBlocker.js
index bb7e482e108dfb6d82778364b349a752a8cd4f99..3a674e3c51c62aa17ba7ae07271e37049bed2917 100644
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -146,7 +146,7 @@ function onFilterChange(arg, isDisabledAction)
});
}
-FilterNotifier.on("subscription.added", onFilterChange)
+FilterNotifier.on("subscription.added", onFilterChange);
FilterNotifier.on("subscription.removed", onFilterChange);
FilterNotifier.on("subscription.updated", onFilterChange);
FilterNotifier.on("subscription.disabled", arg => onFilterChange(arg, true));
@@ -154,3 +154,14 @@ FilterNotifier.on("filter.added", onFilterChange);
FilterNotifier.on("filter.removed", onFilterChange);
FilterNotifier.on("filter.disabled", arg => onFilterChange(arg, true));
FilterNotifier.on("load", onFilterChange);
+
+port.on("websocket-request", function(msg, sender)
+{
+ var results = ext.webRequest.onBeforeRequest._dispatch(
+ new URL(msg.url),
+ "OTHER",
+ sender.page,
+ sender.frame
+ );
+ return results.indexOf(false) != -1;
+});
« no previous file with comments | « include.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld