Opened 12 months ago

Closed 2 months ago

#4713 closed change (duplicate)

Switch from Shadow DOM v0 to Shadow DOM v1

Reported by: hayato Assignee:
Priority: P2 Milestone:
Module: Platform Keywords: externaldependency
Cc: kzar, sebastian, mapx, arthur, hfiguiere, kochi Blocked By:
Blocking: Platform: Chrome
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Background

It looks that AdBlock Plus is using Shadow DOM v0 APIs, createShadowRoot(), which is going to be deprecated.

https://github.com/adblockplus/adblockpluschrome/blob/918892096eb249c49c73e32fd73b111fc5217c28/include.preload.js#L506

What to change

Google Chrome is going to deprecate old Shadow DOM v0 APIs.

I really appreciate if AdBlock Plus could switch to use new Shadow DOM v1 APIs, attachShadow(), instead of old V0 APIs.

For more context, please see the following thread in blink-dev:

"Intent to Deprecate: Shadow DOM v0": https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/txIN7qDRFpU/iFTNP8adAgAJ

Change History (12)

comment:1 Changed 12 months ago by mapx

  • Cc kzar sebastian mapx added

comment:2 Changed 12 months ago by kzar

Thanks for taking the time to reach out to us.

We are aware of this and of course would like to avoid using deprecated APIs, however it sounds like the new API is not suitable for our use:

Quoting Thomas:

I know but unfortunately, we won't be able to use Shadow DOM v1 since it doesn't allow
complex CSS selectors anymore for selecting and styling elements in the light DOM. That
means that we need to abandon the Shadow DOM approach for element hiding as soon as v0
is being removed from browsers.

Worse still with Chromium issue #632009 our options are even more limited. If there was an extension API like chrome.tabs.insertCSS which allowed us to inject styles which the webpage could not overwrite our use of the Shadow DOM APIs wouldn't be required at all.

Any chance you could push #632009 for us? We would be more than happy to remove our use of the old Shadow DOM APIs if that got fixed.

comment:3 Changed 12 months ago by kzar

  • Keywords externaldependency added
  • Priority changed from Unknown to P2
  • Ready set

(See also issues #4171 and #242.)

comment:4 Changed 12 months ago by hayato

Thank you for explaining the situation. I am glad to hear that you are aware of this.

It sounds Chromium issue #632009 is a blocking issue for the removal.
Let me reply there.

comment:5 Changed 11 months ago by arthur

  • Cc arthur added

comment:6 Changed 9 months ago by kzar

  • Component changed from Unknown to Platform

comment:7 Changed 4 months ago by hfiguiere

  • Cc hfiguiere added

comment:8 follow-ups: Changed 3 months ago by kochi

Hi, is there any updates on this matter?

It looks like something is happening for Chromium issue #632009, does it unblock migrating to using Shadow DOM V1 API or at not using Shadow DOM at all?
(IIUC as adblock plus works for non-Chrome browsers, Shadow DOM is not a mandatory technology, but it is depending on some style feature of Shadow DOM v0.)

comment:9 Changed 3 months ago by mapx

  • Cc kochi added

comment:10 in reply to: ↑ 8 Changed 3 months ago by kzar

Replying to kochi:

Hi, is there any updates on this matter?

It looks like something is happening for Chromium issue #632009, does it unblock migrating to using Shadow DOM V1 API or at not using Shadow DOM at all?
(IIUC as adblock plus works for non-Chrome browsers, Shadow DOM is not a mandatory technology, but it is depending on some style feature of Shadow DOM v0.)

I'm happy to see some more progress there, but until chrome.tabs.insertCSS() uses user stylesheets this issue is blocked.

comment:11 in reply to: ↑ 8 Changed 3 months ago by sebastian

Replying to kochi:

does it unblock migrating to using Shadow DOM V1 API or at not using Shadow DOM at all?

Shadow DOM v1 is useless for what we are doing, mostly due to the restrictions of selectors to match nodes across insertion points. So we don't plan migrating to Shadow DOM v1, but to use chrome.tabs.insertCSS() instead of a content script that creates a shadow root with a stylesheet, once user stylesheets are supported by chrome.tabs.insertCSS().

comment:12 Changed 2 months ago by sebastian

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

Closing as duplicate of #242 (I CC'd hayoti and kochi there, since that issue is private).

Note: See TracTickets for help on using tickets.