| Index: include.preload.js |
| =================================================================== |
| --- a/include.preload.js |
| +++ b/include.preload.js |
| @@ -359,27 +359,33 @@ |
| { |
| // Use Shadow DOM if available as to not mess with with web pages that |
| // rely on the order of their own <style> tags (#309). However, creating |
| // a shadow root breaks running CSS transitions. So we have to create |
| // the shadow root before transistions might start (#452). |
| if (!("createShadowRoot" in document.documentElement)) |
| return null; |
| + // Both Firefox and Chrome 66+ support user style sheets, so we can avoid |
| + // creating an unnecessary shadow root on these platforms. |
| + let [, version] = /\bChrome\/(\d+)\.\d+/.exec(navigator.userAgent) || []; |
| + if (isNaN(version) || version >= 66) |
| + return null; |
|
Sebastian Noack
2018/03/09 00:28:13
I think this can be somewhat simplified:
let ma
Manish Jethani
2018/03/09 00:33:29
Done.
|
| + |
| // Using shadow DOM causes issues on some Google websites, |
| // including Google Docs, Gmail and Blogger (#1770, #2602, #2687). |
| if (/\.(?:google|blogger)\.com$/.test(document.domain)) |
| return null; |
| // 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. |
| let shadow = document.documentElement.shadowRoot || |
| document.documentElement.createShadowRoot(); |
| - shadow.appendChild(document.createElement("shadow")); |
| + shadow.appendChild(document.createElement("content")); |
| return shadow; |
| }, |
| addSelectorsInline(selectors, groupName) |
| { |
| let style = this.styles.get(groupName); |