OLD | NEW |
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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 detail: {url: url} | 399 detail: {url: url} |
400 })); | 400 })); |
401 } | 401 } |
402 | 402 |
403 WebSocket = function WrappedWebSocket(url, protocols) | 403 WebSocket = function WrappedWebSocket(url, protocols) |
404 { | 404 { |
405 // Throw correct exceptions if the constructor is used improperly. | 405 // Throw correct exceptions if the constructor is used improperly. |
406 if (!(this instanceof WrappedWebSocket)) return RealWebSocket(); | 406 if (!(this instanceof WrappedWebSocket)) return RealWebSocket(); |
407 if (arguments.length < 1) return new RealWebSocket(); | 407 if (arguments.length < 1) return new RealWebSocket(); |
408 | 408 |
409 var websocket = new RealWebSocket(url, protocols); | 409 var websocket = new RealWebSocket(url, protocols || []); |
410 | 410 |
411 checkRequest(websocket.url, function(blocked) | 411 checkRequest(websocket.url, function(blocked) |
412 { | 412 { |
413 if (blocked) | 413 if (blocked) |
414 closeWebSocket(websocket); | 414 closeWebSocket(websocket); |
415 }); | 415 }); |
416 | 416 |
417 return websocket; | 417 return websocket; |
418 }.bind(); | 418 }.bind(); |
419 | 419 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 }, true); | 614 }, true); |
615 | 615 |
616 return updateStylesheet; | 616 return updateStylesheet; |
617 } | 617 } |
618 | 618 |
619 if (document instanceof HTMLDocument) | 619 if (document instanceof HTMLDocument) |
620 { | 620 { |
621 checkSitekey(); | 621 checkSitekey(); |
622 window.updateStylesheet = init(document); | 622 window.updateStylesheet = init(document); |
623 } | 623 } |
OLD | NEW |