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

Unified Diff: include.preload.js

Issue 29394585: Issue 5027 - Use updated webRequest API for WebSocket blocking (Closed)
Patch Set: change commit message, add chrome version to include.preload.js comments Created March 29, 2017, 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 | « chrome/ext/background.js ('k') | lib/csp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -337,20 +337,20 @@
let script = document.createElement("script");
script.type = "application/javascript";
script.async = false;
script.textContent = "(" + fn + ")(" + JSON.stringify(arg) + ");";
document.documentElement.appendChild(script);
document.documentElement.removeChild(script);
}
-// Chrome doesn't allow us to intercept WebSockets[1], and therefore
-// some ad networks are misusing them as a way to serve adverts and circumvent
-// us. As a workaround we wrap WebSocket, preventing blocked WebSocket
-// connections from being opened.
+// Before Chrome 58 the webRequest API didn't allow us to intercept
+// WebSockets[1], and therefore some ad networks are misusing them as a way to
+// serve adverts and circumvent us. As a workaround we wrap WebSocket,
+// preventing blocked WebSocket connections from being opened.
// [1] - https://bugs.chromium.org/p/chromium/issues/detail?id=129353
function wrapWebSocket()
{
let eventName = "abpws-" + Math.random().toString(36).substr(2);
document.addEventListener(eventName, event =>
{
ext.backgroundPage.sendMessage({
« no previous file with comments | « chrome/ext/background.js ('k') | lib/csp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld