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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 }); | 136 }); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 /* | 140 /* |
141 * Closed shadowRoot prevention. | 141 * Closed shadowRoot prevention. |
142 * https://issues.adblockplus.org/ticket/5650 | 142 * https://issues.adblockplus.org/ticket/5650 |
143 */ | 143 */ |
144 if ("attachShadow" in Element.prototype) | 144 if ("attachShadow" in Element.prototype) |
145 { | 145 { |
146 Element.prototype._attachShadow = Element.prototype.attachShadow; | 146 let _attachShadow = Element.prototype.attachShadow; |
147 Element.prototype.attachShadow = options => { | 147 Element.prototype.attachShadow = options => |
148 if (options && options.mode == "closed") { | 148 { |
| 149 if (options && options.mode == "closed") |
149 options.mode = "open"; | 150 options.mode = "open"; |
150 } | 151 |
151 return this._attachShadow(options); | 152 return _attachShadow.call(this, options); |
152 }; | 153 }; |
153 } | 154 } |
154 | 155 |
155 /* | 156 /* |
156 * Shared request checking code, used by both the WebSocket and | 157 * Shared request checking code, used by both the WebSocket and |
157 * RTCPeerConnection wrappers. | 158 * RTCPeerConnection wrappers. |
158 */ | 159 */ |
159 let RealCustomEvent = window.CustomEvent; | 160 let RealCustomEvent = window.CustomEvent; |
160 | 161 |
161 // If we've been injected into a frame via contentWindow then we can simply | 162 // If we've been injected into a frame via contentWindow then we can simply |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) | 412 if (typeof sandbox != "string" || /(^|\s)allow-scripts(\s|$)/i.test(sandbox)) |
412 { | 413 { |
413 let script = document.createElement("script"); | 414 let script = document.createElement("script"); |
414 script.type = "application/javascript"; | 415 script.type = "application/javascript"; |
415 script.async = false; | 416 script.async = false; |
416 script.textContent = "(" + injected + ")('" + randomEventName + "');"; | 417 script.textContent = "(" + injected + ")('" + randomEventName + "');"; |
417 document.documentElement.appendChild(script); | 418 document.documentElement.appendChild(script); |
418 document.documentElement.removeChild(script); | 419 document.documentElement.removeChild(script); |
419 } | 420 } |
420 } | 421 } |
LEFT | RIGHT |