Index: include.preload.js |
diff --git a/include.preload.js b/include.preload.js |
index 7acdbb149870180bd26785a5fd8a7432da1db692..cd482c8fd8dbe743c8a806ef2f1e6a8983bc4304 100644 |
--- a/include.preload.js |
+++ b/include.preload.js |
@@ -459,10 +459,15 @@ function init(document) |
// |
// Also, using shadow DOM causes issues on some Google websites, |
// including Google Docs, Gmail and Blogger (#1770, #2602, #2687). |
+ // |
+ // Finally since some users have both AdBlock and Adblock Plus installed we |
+ // have to consider how the two extensions interact. For example we want to |
+ // avoid creating the shadowRoot twice. |
if ("createShadowRoot" in document.documentElement && |
!/\.(?:google|blogger)\.com$/.test(document.domain)) |
{ |
- shadow = document.documentElement.createShadowRoot(); |
+ shadow = document.documentElement.shadowRoot || |
+ document.documentElement.createShadowRoot(); |
Sebastian Noack
2016/11/17 15:38:00
Nit: It seems the indentation is off by 2 characte
kzar
2016/11/17 15:45:54
Done.
|
shadow.appendChild(document.createElement("shadow")); |
// Stop the website from messing with our shadowRoot |
@@ -471,6 +476,8 @@ function init(document) |
runInDocument(document, function() |
{ |
var ourShadowRoot = document.documentElement.shadowRoot; |
+ if (!ourShadowRoot) |
+ return; |
var desc = Object.getOwnPropertyDescriptor(Element.prototype, "shadowRoot"); |
var shadowRoot = Function.prototype.call.bind(desc.get); |