Index: inject.preload.js |
=================================================================== |
--- a/inject.preload.js |
+++ b/inject.preload.js |
@@ -133,16 +133,31 @@ |
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; |
+ Element.prototype.attachShadow = options => { |
+ if (options && options.mode == "closed") { |
+ options.mode = "open"; |
+ } |
+ 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. |