| Index: inject.preload.js |
| =================================================================== |
| --- a/inject.preload.js |
| +++ b/inject.preload.js |
| @@ -133,16 +133,32 @@ |
| let thisShadow = shadowRoot(this); |
| return thisShadow == ourShadowRoot ? null : thisShadow; |
| } |
| }); |
| } |
| } |
| /* |
| + * Closed shadowRoot prevention. |
| + * https://issues.adblockplus.org/ticket/5650 |
| + */ |
| + if ("attachShadow" in Element.prototype) |
| + { |
| + Element.prototype._attachShadow = Element.prototype.attachShadow; |
|
lainverse
2017/09/29 15:57:35
You left unwrapped _attachShadow right in the same
hub
2017/09/29 16:54:29
good point. done.
|
| + Element.prototype.attachShadow = options => |
| + { |
| + if (options && options.mode == "closed") |
| + options.mode = "open"; |
|
lainverse
2017/09/29 15:57:35
This is indeed the easiest solution, but I think t
|
| + |
| + return this._attachShadow(options); |
| + }; |
| + } |
| + |
| + /* |
| * Shared request checking code, used by both the WebSocket and |
| * RTCPeerConnection wrappers. |
| */ |
| let RealCustomEvent = window.CustomEvent; |
| // If we've been injected into a frame via contentWindow then we can simply |
| // grab the copy of checkRequest left for us by the parent document. Otherwise |
| // we need to set it up now, along with the event handling functions. |