LEFT | RIGHT |
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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
458 var properties = Object.getOwnPropertyNames(RealWebSocket); | 458 Object.defineProperties(WebSocket, { |
459 for (var i = 0; i < properties.length; i++) | 459 CONNECTING: {value: RealWebSocket.CONNECTING, enumerable: true}, |
460 { | 460 OPEN: {value: RealWebSocket.OPEN, enumerable: true}, |
461 var name = properties[i]; | 461 CLOSING: {value: RealWebSocket.CLOSING, enumerable: true}, |
462 var desc = Object.getOwnPropertyDescriptor(RealWebSocket, name); | 462 CLOSED: {value: RealWebSocket.CLOSED, enumerable: true}, |
463 Object.defineProperty(WebSocket, name, desc); | 463 prototype: {value: RealWebSocket.prototype} |
464 } | 464 }); |
465 | 465 |
466 RealWebSocket.prototype.constructor = WebSocket; | 466 RealWebSocket.prototype.constructor = WebSocket; |
467 }, eventName); | 467 }, eventName); |
468 } | 468 } |
469 | 469 |
470 function init(document) | 470 function init(document) |
471 { | 471 { |
472 var shadow = null; | 472 var shadow = null; |
473 var style = null; | 473 var style = null; |
474 var observer = null; | 474 var observer = null; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 }, true); | 639 }, true); |
640 | 640 |
641 return updateStylesheet; | 641 return updateStylesheet; |
642 } | 642 } |
643 | 643 |
644 if (document instanceof HTMLDocument) | 644 if (document instanceof HTMLDocument) |
645 { | 645 { |
646 checkSitekey(); | 646 checkSitekey(); |
647 window.updateStylesheet = init(document); | 647 window.updateStylesheet = init(document); |
648 } | 648 } |
LEFT | RIGHT |