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

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.

http://c.speedtest.net/javascript/speedtest-main.js?p=BJIYQ46qcn06&r=6260TU1USUl-SzZ7MCsxKjE1KDIzI0h9KCsxfiIuKyowSCohMEkrKycoe0gmLw%3D%3D&q=207437xt%3DGl9%26%40%3DlD%26kD%3DCmw&s=C392600RWhhXV5FemFXRWphVF5XX1peV11dX1hcXl5dWllgXlhFbmEy%3D&i=

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:1 Changed on 11/30/2015 at 10:57:18 AM by greiner

  • Description modified (diff)

comment:2 in reply to: ↑ description Changed on 11/30/2015 at 11:50:31 AM by sebastian

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:

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.

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.

comment:3 Changed on 02/15/2016 at 09:42:09 PM by mapx

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.

comment:5 Changed on 09/22/2017 at 06:48:53 PM by sebastian

  • Resolution set to duplicate
  • Status changed from new to closed

Closing as duplicate of #242, also see #4713.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none).
 
Note: See TracTickets for help on using tickets.