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) |
+ { |
+ let _attachShadow = Element.prototype.attachShadow; |
+ Element.prototype.attachShadow = options => |
+ { |
+ if (options && options.mode == "closed") |
+ options.mode = "open"; |
+ |
+ return _attachShadow.call(this, options); |
lainverse
2017/10/02 06:41:21
Arrow functions doesn't have their own 'this' and
|
+ }; |
+ } |
+ |
+ /* |
* 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. |