Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 29349823: Fixes 4328 - Multiple shadowRoot deprecated warnings (Closed)
Patch Set: Created Aug. 15, 2016, 8:27 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
diff --git a/include.preload.js b/include.preload.js
index 1ea213d7479fed931b8dc3985746cc162fc6dc77..d3083bc44a534530ccca61aae40cf9ce326d782a 100644
--- a/include.preload.js
+++ b/include.preload.js
@@ -458,8 +458,12 @@ 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 at
+ // once we have to be careful not to create the shadowRoot twice!
if ("createShadowRoot" in document.documentElement &&
- !/\.(?:google|blogger)\.com$/.test(document.domain))
+ !/\.(?:google|blogger)\.com$/.test(document.domain) &&
+ !document.documentElement.shadowRoot)
{
shadow = document.documentElement.createShadowRoot();
shadow.appendChild(document.createElement("shadow"));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld