Opened on 11/28/2015 at 09:59:18 AM
Closed on 09/22/2017 at 06:48:53 PM
#3356 closed defect (duplicate)
Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated
Reported by: | mapx | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Platform | Keywords: | |
Cc: | sebastian, greiner, kzar | Blocked By: | |
Blocking: | Platform: | Chrome | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by greiner)
Environment
windows 10
ABP 1.9.4.1498
chrome Version 47.0.2526.73 beta-m (64-bit)
How to reproduce
- use a US VPN (in my european country does not happen)
- go to http://www.speedtest.net/
- go into console
I can see this warning message:
Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated. See https://www.chromestatus.com/feature/4769966083538944 for more details.
This could be why the ads on chrome (for speedtest) aren't blocked / hidden ? In firefox + ABP it's ok. Also, I get the ads only using an US VPN.
Attachments (0)
Change History (5)
comment:2 in reply to: ↑ description Changed on 11/30/2015 at 11:50:31 AM by sebastian
comment:3 Changed on 02/15/2016 at 09:42:09 PM by mapx
the chrome issue was fixed:
https://code.google.com/p/chromium/issues/detail?id=63979
comment:4 Changed on 02/16/2016 at 09:45:16 AM by sebastian
That's true. We, however, found another issue with chrome.tabs.insertCSS. Stylesheets injected using that API have lower priority than any other stylesheet. So websites could easily override our styles, and they wouldn't even have to use inline styles therefore. So unfortunatelly, unless Chrome reintroduces user stylesheets, and uses these for chrome.tabs.insertCSS, that API is more or less useless.
I don't really see a way to tackle this, while using shadow DOM. We create our shadow DOM before any of the page's JS runs. So checking for an existing shadow root won't help. And creating our shadow root later would cause other issues, see #452.
On a related note createShadowRoot has been removed from the standard and got superseded by attachShadowRoot which however neither supports multiple shadow trees, besides not being implemented by any browser yet.
Also considering other issues we run into with shadow DOM so far, and the growing list of workarounds we had to implement, maybe it's time to give up on shadow DOM for element hiding.
Note that we initially started to use shadow DOM to avoid side effects on pages that rely on the order/presense of own stylesheets in the light DOM. However, once chrome.tabs.insertCSS supports specifying a frameId we could use that API instead.
Replying to mapx:
That is unlikely. As of now, it should work as it has used to be, but merely showing a warning. However, it's also unlikely that chrome.tabs.insertCSS will solve issues like that as we still stick with an author stylesheet on Chrome as opposed to Firefox where we can use user stylesheets which have a higher priority.