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

Delta Between Two Patch Sets: include.preload.js

Issue 29347034: Issue 1727 - Prevent circumvention via WebSocket (Closed)
Left Patch Set: Fix WebSocket properties for Safari Created Aug. 10, 2016, 3:41 p.m.
Right Patch Set: Don't hardcode connection state values Created Aug. 10, 2016, 4:25 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/requestBlocker.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 var websocket = new RealWebSocket(url, protocols); 447 var websocket = new RealWebSocket(url, protocols);
448 448
449 checkRequest(websocket.url, function(blocked) 449 checkRequest(websocket.url, function(blocked)
450 { 450 {
451 if (blocked) 451 if (blocked)
452 closeWebSocket(websocket); 452 closeWebSocket(websocket);
453 }); 453 });
454 454
455 return websocket; 455 return websocket;
456 }.bind(); 456 }.bind();
457
457 Object.defineProperties(WebSocket, { 458 Object.defineProperties(WebSocket, {
458 CONNECTING: {value: 0, enumerable: true}, 459 CONNECTING: {value: RealWebSocket.CONNECTING, enumerable: true},
Sebastian Noack 2016/08/10 16:15:39 Still not a reason to hard-code the values: Obj
kzar 2016/08/10 16:20:07 Added the blank lines back, sorry didn't mean to r
459 OPEN: {value: 1, enumerable: true}, 460 OPEN: {value: RealWebSocket.OPEN, enumerable: true},
460 CLOSING: {value: 2, enumerable: true}, 461 CLOSING: {value: RealWebSocket.CLOSING, enumerable: true},
461 CLOSED: {value: 3, enumerable: true}, 462 CLOSED: {value: RealWebSocket.CLOSED, enumerable: true},
462 prototype: {value: RealWebSocket.prototype} 463 prototype: {value: RealWebSocket.prototype}
463 }); 464 });
465
464 RealWebSocket.prototype.constructor = WebSocket; 466 RealWebSocket.prototype.constructor = WebSocket;
465 }, eventName); 467 }, eventName);
466 } 468 }
467 469
468 function init(document) 470 function init(document)
469 { 471 {
470 var shadow = null; 472 var shadow = null;
471 var style = null; 473 var style = null;
472 var observer = null; 474 var observer = null;
473 var tracer = null; 475 var tracer = null;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 }, true); 639 }, true);
638 640
639 return updateStylesheet; 641 return updateStylesheet;
640 } 642 }
641 643
642 if (document instanceof HTMLDocument) 644 if (document instanceof HTMLDocument)
643 { 645 {
644 checkSitekey(); 646 checkSitekey();
645 window.updateStylesheet = init(document); 647 window.updateStylesheet = init(document);
646 } 648 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld