SlideShare a Scribd company logo
Fixing Gaps: Strengthening the
Chromium Platform for Content
Blocking
myid.shin@igalia.com
ltilve@igalia.com
Agenda
● About Igalia
● New features for Content Blocking
● The need for tabs.removeCSS and extending exension new API
● What is Shadow Root / Why we need to access “closed shadow root”?
● Implement in Blink / Intent to Ship: blink-dev@
● For new extension API
● Implement in chrome / Proposal document / How to use
● Release schedule
● Future plans
About Igalia
● Open Source Consultancy with HQ in Galicia, Spain
○ 90 employees all around the world
○ Mainly specialized on Browsers and Web Engines:
○ Chromium, Firefox, WebKit and WPE
○ Compilers, JavaScript engines, Graphics, Multimedia, Accessibility
Fixing Gaps. Strengthening the Chromium platform for content blocking
New features for Content Blocking
Add a chrome.tabs.removeCSS (https://crbug.com/608854)
Add a chrome.dom.openOrClosedShadowRoot (https://crbug.com/778816)
Apply content scripts to about: and data: urls (https://crbug.com/55084)
The need for tabs.removeCSS
● A way to hide blocked ads is by adding new CSS rules through existing
chrome.tabs.insertCSS
○ https://developer.chrome.com/extensions/tabs#method-insertCSS
● However, as content changes dynamically, it was necessary to have a
mechanism in Chromium to modify the visibility of elements that vary over
time.
● A removeCSS method as already available on other engines:
○ https://bugzilla.mozilla.org/show_bug.cgi?id=1247455
The need for tabs.removeCSS
● There was an open upstream issue for it (https://crbug.com/608854)
● An initial CL for it had been started by Manish Jethani but got discontinued
○ https://crrev.com/c/918606
● The bug was taken over and work completed by Antonio Gomes
○ Updated original CL to use the new APIs
○ Created new issue for “Extension API Modification: chrome.tabs.removeCSS”
(https://crbug.com/1101473)
○ Added the necessary functional tests
○ Iterated the through the review process
○ Got it landed (https://crrev.com/c/2250506)
● Implementation adds security restriction that extensions can only remove their
own injected CSS.
The need for tabs.removeCSS
tabs.removeCSS new API
● The new API method definition is added to
chrome/common/extensions/api/tabs.json
"name": "removeCSS",
"type": "function",
"description" “Remove CSS injected by $(ref:tabs.insertCSS).",
"parameters":
"tabId" : “ID of the tab from which to remove the CSS; defaults to active one.”
"details" : “Details of the CSS text to remove.”
"callback" : “Called when all the CSS has been removed.”
● And the new extension types objects into
extensions/common/api/extension_types.json
"id": "DeleteInjectionDetails",
"type": "object",
"description": "CSS to remove. Either the code or the file property, but not both",
"properties": {
"code" : “CSS code to remove”,
"file" : “CSS file to remove”,
"allFrames" : “If should be removed from all frames or just the top one”,
"frameId": “The frame from where the CSS should be removed”
tabs.removeCSS new API
● Function
chrome/test/data/extensions/api_test/executescript/remove_css/*
async function removeCSSWithFileShouldSucceed() {
// When no frame ID is specified, the CSS is removed from the top frame.
await testRemoveCSS({file}, [originalColor, , , , , ]);
chrome.test.succeed();
},
async function removeCSSWithDifferentFileShouldDoNothing() {
// The CSS is not removed even though "/file.css" and "/other.css" are identical.
await testRemoveCSS({file: '/other.css' , allFrames: true});
chrome.test.succeed();
},
tabs.removeCSS new API
tabs.removeCSS new API
● API doc https://developer.chrome.com/extensions/tabs#method-removeCSS
Adding Shadow Root access API
What is Shadow Root
Encapsulation : a component to have its very own “shadow” DOM tree.
https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM
What is Shadow Root
mode options to attach a shadow root
let shadow1 = element1.attachShadow({mode: 'open'});
let shadow2 = element2.attachShadow({mode: 'closed'});
element1.shadowRoot === shadow1; // true
element2.shadowRoot === null; // true
Why we need to access “closed shadow root”?
● Ads hidden behind closed shadow root
● Extensions APIs on the user's behalf
● Existing workaround using Extensions APIs
● NOT a security issue
● Firefox supports Element.openOrClosedShadowRoot
Implement in Blink
● Element.prototype.openOrClosedShadowRoot
● Specify API with Web IDL.
● But,
○ Do not expose it to general Web
○ Expose it to only isolated content script of Extensions
[Affects=Nothing, ExposedPerWorld=IsolatedWorld , NotEnumerable,
CheckSecurity=ReturnValue, Custom=Getter] readonly attribute
ShadowRoot? openOrClosedShadowRoot;
third_party/blink/renderer/core/dom/element.idl
Intent to Ship: blink-dev@
● The Chromium process to launch a new feature in Blink
○ https://www.chromium.org/blink/launching-features
● Two main concerns
○ Web namespace pollution
○ Web IDL lack for custom
○ https://groups.google.com/a/chromium.org/g/blink-dev/c/VEVXgm83UXk/m/iiIBCA
kXAgAJ
Element.prototype.openOrClosedShadowRoot
For new extension API
● Proposal :
https://chromium.googlesource.com/chromium/src/+/master/extensions/docs/
new_api_proposal.md
● Implementing :
https://www.chromium.org/developers/design-documents/extensions/propose
d-changes/creating-new-apis
Proposal document
(extension-api-reviews@chromium.org)
https://docs.google.com/document
/d/1Uj1Ff-3Kdbgb1JnCcZVj7EcWv
8jXj8wW2AlPfVfCUdI/edit?usp=sh
aring
Implement in chrome
● chrome.dom.openOrClosedShadowRoot
● Specify API with json
● C++ implementation
"namespace": "dom",
"functions": [{
"name": "openOrClosedShadowRoot",
"parameters": [{"name": "element", "type": "object"} ],
"returns": { "name": "shadowRoot", "type": "object" }
}]
chrome/common/extensions/api/dom.json
extensions/renderer/dom_hooks_delegate.{cc, h}
Implement in chrome
● chrome.dom.openOrClosedShadowRoot
● Specify API availability : content scripts & blessed contexts
● Unnecessary to specify permission, manifest entry and behavior availabilities
"dom": {
"channel": "dev",
"contexts": ["blessed_extension", "content_script"]
},
chrome/common/extensions/api/_api_features.json
How to use
let shadow1 = element1.attachShadow({mode: 'open'});
let shadow2 = element2.attachShadow({mode: 'closed'});
element1.shadowRoot === shadow1; // true
element2.shadowRoot === null; // true
chrome.dom.openOrClosedShadowRoot (element1) === shadow1; // true
chrome.dom.openOrClosedShadowRoot (element2) === shadow2; // true
Release schedule and future plans
Release schedule
● For chrome.tabs.removeCSS on M87
● For chrome.dom.openOrClosedShadowRoot on M87 / M88
Future plans and ongoing work
● Moving forward implementation of new CSS selectors to ease element hiding
○ Working on a prototype for :has() pseudo selector
https://github.com/w3c/csswg-drafts/issues/4903
○ Intent to proto type and ship of :dir() pseudo class
(https://chromium-review.googlesource.com/c/chromium/src/+/2460849)
○ Intent to ship complex :not()
(https://groups.google.com/a/chromium.org/g/blink-dev/c/0alTkXvDCL8/m/-ClOGv
OJBAAJ)
● Ongoing progress on increasing Chromium capabilities for content-blocking useful
features as more selectors, or incoming JS spec implementations.
Thanks

More Related Content

PDF
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
PDF
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
PDF
Writing native Linux desktop apps with JavaScript
PDF
Overview of the open source Vulkan driver for Raspberry Pi 4 (XDC 2020)
PDF
Embedding Chromium into AGL demo platform with WAM
PDF
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
PDF
Improving Chromium's code health: Onion Soup and beyond (BlinkOn 11)
PDF
Essential parts to implement own Ozone backend
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Writing native Linux desktop apps with JavaScript
Overview of the open source Vulkan driver for Raspberry Pi 4 (XDC 2020)
Embedding Chromium into AGL demo platform with WAM
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
Improving Chromium's code health: Onion Soup and beyond (BlinkOn 11)
Essential parts to implement own Ozone backend

What's hot (20)

PDF
Chromium Ozone
PDF
What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)
PPTX
JS digest. February 2017
PDF
WPE WebKit for Android
PPTX
JS digest. January 2017
PDF
Alternative approach to native Kotlin
PDF
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
PDF
Compiling To Web Assembly
PDF
Ewebkit basic (Web rendering enging of EFL)
PDF
Chromium on Wayland Desktop (BlinkOn 7)
PDF
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
PDF
Dev/Stage/Prod Parity with Vagrant
PDF
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
PDF
Petri Niemi Qt Web Kit
PDF
Multimedia in WebKitGtk+, past/present/future
PPTX
#2 Hanoi Magento Meetup - Part 2: Knockout JS
PDF
WebKit2 And You (GUADEC 2013)
PDF
Sep Nasiri "Upwork PHP Architecture"
PPTX
Introduction to React
PDF
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Chromium Ozone
What's new with JavaScript in GNOME: The 2020 edition (GUADEC 2020)
JS digest. February 2017
WPE WebKit for Android
JS digest. January 2017
Alternative approach to native Kotlin
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
Compiling To Web Assembly
Ewebkit basic (Web rendering enging of EFL)
Chromium on Wayland Desktop (BlinkOn 7)
WebKit Clutter Port Present and Future; WebKitGtk Status and Roadmap to WebKi...
Dev/Stage/Prod Parity with Vagrant
Pairing WebKit and Wayland for Linux-Based Embedded Web Content Presentation ...
Petri Niemi Qt Web Kit
Multimedia in WebKitGtk+, past/present/future
#2 Hanoi Magento Meetup - Part 2: Knockout JS
WebKit2 And You (GUADEC 2013)
Sep Nasiri "Upwork PHP Architecture"
Introduction to React
Integration of the Chromium Browser in the GENIVI Platform (16th GENIVI AMM)
Ad

Similar to Fixing Gaps. Strengthening the Chromium platform for content blocking (20)

PDF
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
PDF
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
PDF
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
PPTX
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
PDF
Image archive, analysis & report generation with Google Cloud
PDF
JSFest 2019: Technology agnostic microservices at SPA frontend
PDF
Accessing Google Cloud APIs
PDF
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
ODP
21 05-2018
PDF
how to use openstack api
PPTX
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
PPTX
Web Components: back to the future
PDF
RICOH THETA x IoT Developers Contest : Cloud API Seminar
PDF
Exploring Google (Cloud) APIs with Python & JavaScript
PDF
Kubernetes fingerprinting with Prometheus.pdf
PDF
Mastering Grails 3 Plugins - Greach 2016
PDF
Mastering Grails 3 Plugins - GR8Conf EU 2016
PDF
Masterless Puppet Using AWS S3 Buckets and IAM Roles
PDF
Chrome Extensions for Web Hackers
PDF
Mastering Grails 3 Plugins - GR8Conf US 2016
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
Image archive, analysis & report generation with Google Cloud
JSFest 2019: Technology agnostic microservices at SPA frontend
Accessing Google Cloud APIs
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
21 05-2018
how to use openstack api
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Web Components: back to the future
RICOH THETA x IoT Developers Contest : Cloud API Seminar
Exploring Google (Cloud) APIs with Python & JavaScript
Kubernetes fingerprinting with Prometheus.pdf
Mastering Grails 3 Plugins - Greach 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Chrome Extensions for Web Hackers
Mastering Grails 3 Plugins - GR8Conf US 2016
Ad

More from Igalia (20)

PDF
Life of a Kernel Bug Fix
PDF
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
PDF
Advancing WebDriver BiDi support in WebKit
PDF
Jumping Over the Garden Wall - WPE WebKit on Android
PDF
Collective Funding, Governance and Prioritiation of Browser Engine Projects
PDF
Don't let your motivation go, save time with kworkflow
PDF
Solving the world’s (localization) problems
PDF
The Whippet Embeddable Garbage Collection Library
PDF
Nobody asks "How is JavaScript?"
PDF
Getting more juice out from your Raspberry Pi GPU
PDF
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
PDF
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
PDF
CSS :has() Unlimited Power
PDF
Device-Generated Commands in Vulkan
PDF
Current state of Lavapipe: Mesa's software renderer for Vulkan
PDF
Vulkan Video is Open: Application showcase
PDF
Scheme on WebAssembly: It is happening!
PDF
EBC - A new backend compiler for etnaviv
PDF
RISC-V LLVM State of the Union
PDF
Device-Generated Commands in Vulkan
Life of a Kernel Bug Fix
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
Advancing WebDriver BiDi support in WebKit
Jumping Over the Garden Wall - WPE WebKit on Android
Collective Funding, Governance and Prioritiation of Browser Engine Projects
Don't let your motivation go, save time with kworkflow
Solving the world’s (localization) problems
The Whippet Embeddable Garbage Collection Library
Nobody asks "How is JavaScript?"
Getting more juice out from your Raspberry Pi GPU
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
CSS :has() Unlimited Power
Device-Generated Commands in Vulkan
Current state of Lavapipe: Mesa's software renderer for Vulkan
Vulkan Video is Open: Application showcase
Scheme on WebAssembly: It is happening!
EBC - A new backend compiler for etnaviv
RISC-V LLVM State of the Union
Device-Generated Commands in Vulkan

Recently uploaded (20)

PDF
Sims 4 Historia para lo sims 4 para jugar
PPT
tcp ip networks nd ip layering assotred slides
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
Funds Management Learning Material for Beg
PPTX
Introduction to Information and Communication Technology
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
DOCX
Unit-3 cyber security network security of internet system
Sims 4 Historia para lo sims 4 para jugar
tcp ip networks nd ip layering assotred slides
PptxGenJS_Demo_Chart_20250317130215833.pptx
Introuction about WHO-FIC in ICD-10.pptx
Funds Management Learning Material for Beg
Introduction to Information and Communication Technology
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
presentation_pfe-universite-molay-seltan.pptx
Module 1 - Cyber Law and Ethics 101.pptx
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
introduction about ICD -10 & ICD-11 ppt.pptx
Decoding a Decade: 10 Years of Applied CTI Discipline
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
RPKI Status Update, presented by Makito Lay at IDNOG 10
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Triggering QUIC, presented by Geoff Huston at IETF 123
522797556-Unit-2-Temperature-measurement-1-1.pptx
Unit-3 cyber security network security of internet system

Fixing Gaps. Strengthening the Chromium platform for content blocking

  • 1. Fixing Gaps: Strengthening the Chromium Platform for Content Blocking myid.shin@igalia.com ltilve@igalia.com
  • 2. Agenda ● About Igalia ● New features for Content Blocking ● The need for tabs.removeCSS and extending exension new API ● What is Shadow Root / Why we need to access “closed shadow root”? ● Implement in Blink / Intent to Ship: blink-dev@ ● For new extension API ● Implement in chrome / Proposal document / How to use ● Release schedule ● Future plans
  • 3. About Igalia ● Open Source Consultancy with HQ in Galicia, Spain ○ 90 employees all around the world ○ Mainly specialized on Browsers and Web Engines: ○ Chromium, Firefox, WebKit and WPE ○ Compilers, JavaScript engines, Graphics, Multimedia, Accessibility
  • 5. New features for Content Blocking Add a chrome.tabs.removeCSS (https://crbug.com/608854) Add a chrome.dom.openOrClosedShadowRoot (https://crbug.com/778816) Apply content scripts to about: and data: urls (https://crbug.com/55084)
  • 6. The need for tabs.removeCSS ● A way to hide blocked ads is by adding new CSS rules through existing chrome.tabs.insertCSS ○ https://developer.chrome.com/extensions/tabs#method-insertCSS ● However, as content changes dynamically, it was necessary to have a mechanism in Chromium to modify the visibility of elements that vary over time. ● A removeCSS method as already available on other engines: ○ https://bugzilla.mozilla.org/show_bug.cgi?id=1247455
  • 7. The need for tabs.removeCSS ● There was an open upstream issue for it (https://crbug.com/608854) ● An initial CL for it had been started by Manish Jethani but got discontinued ○ https://crrev.com/c/918606
  • 8. ● The bug was taken over and work completed by Antonio Gomes ○ Updated original CL to use the new APIs ○ Created new issue for “Extension API Modification: chrome.tabs.removeCSS” (https://crbug.com/1101473) ○ Added the necessary functional tests ○ Iterated the through the review process ○ Got it landed (https://crrev.com/c/2250506) ● Implementation adds security restriction that extensions can only remove their own injected CSS. The need for tabs.removeCSS
  • 9. tabs.removeCSS new API ● The new API method definition is added to chrome/common/extensions/api/tabs.json "name": "removeCSS", "type": "function", "description" “Remove CSS injected by $(ref:tabs.insertCSS).", "parameters": "tabId" : “ID of the tab from which to remove the CSS; defaults to active one.” "details" : “Details of the CSS text to remove.” "callback" : “Called when all the CSS has been removed.”
  • 10. ● And the new extension types objects into extensions/common/api/extension_types.json "id": "DeleteInjectionDetails", "type": "object", "description": "CSS to remove. Either the code or the file property, but not both", "properties": { "code" : “CSS code to remove”, "file" : “CSS file to remove”, "allFrames" : “If should be removed from all frames or just the top one”, "frameId": “The frame from where the CSS should be removed” tabs.removeCSS new API
  • 11. ● Function chrome/test/data/extensions/api_test/executescript/remove_css/* async function removeCSSWithFileShouldSucceed() { // When no frame ID is specified, the CSS is removed from the top frame. await testRemoveCSS({file}, [originalColor, , , , , ]); chrome.test.succeed(); }, async function removeCSSWithDifferentFileShouldDoNothing() { // The CSS is not removed even though "/file.css" and "/other.css" are identical. await testRemoveCSS({file: '/other.css' , allFrames: true}); chrome.test.succeed(); }, tabs.removeCSS new API
  • 12. tabs.removeCSS new API ● API doc https://developer.chrome.com/extensions/tabs#method-removeCSS
  • 13. Adding Shadow Root access API
  • 14. What is Shadow Root Encapsulation : a component to have its very own “shadow” DOM tree. https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM
  • 15. What is Shadow Root mode options to attach a shadow root let shadow1 = element1.attachShadow({mode: 'open'}); let shadow2 = element2.attachShadow({mode: 'closed'}); element1.shadowRoot === shadow1; // true element2.shadowRoot === null; // true
  • 16. Why we need to access “closed shadow root”? ● Ads hidden behind closed shadow root ● Extensions APIs on the user's behalf ● Existing workaround using Extensions APIs ● NOT a security issue ● Firefox supports Element.openOrClosedShadowRoot
  • 17. Implement in Blink ● Element.prototype.openOrClosedShadowRoot ● Specify API with Web IDL. ● But, ○ Do not expose it to general Web ○ Expose it to only isolated content script of Extensions [Affects=Nothing, ExposedPerWorld=IsolatedWorld , NotEnumerable, CheckSecurity=ReturnValue, Custom=Getter] readonly attribute ShadowRoot? openOrClosedShadowRoot; third_party/blink/renderer/core/dom/element.idl
  • 18. Intent to Ship: blink-dev@ ● The Chromium process to launch a new feature in Blink ○ https://www.chromium.org/blink/launching-features ● Two main concerns ○ Web namespace pollution ○ Web IDL lack for custom ○ https://groups.google.com/a/chromium.org/g/blink-dev/c/VEVXgm83UXk/m/iiIBCA kXAgAJ Element.prototype.openOrClosedShadowRoot
  • 19. For new extension API ● Proposal : https://chromium.googlesource.com/chromium/src/+/master/extensions/docs/ new_api_proposal.md ● Implementing : https://www.chromium.org/developers/design-documents/extensions/propose d-changes/creating-new-apis
  • 21. Implement in chrome ● chrome.dom.openOrClosedShadowRoot ● Specify API with json ● C++ implementation "namespace": "dom", "functions": [{ "name": "openOrClosedShadowRoot", "parameters": [{"name": "element", "type": "object"} ], "returns": { "name": "shadowRoot", "type": "object" } }] chrome/common/extensions/api/dom.json extensions/renderer/dom_hooks_delegate.{cc, h}
  • 22. Implement in chrome ● chrome.dom.openOrClosedShadowRoot ● Specify API availability : content scripts & blessed contexts ● Unnecessary to specify permission, manifest entry and behavior availabilities "dom": { "channel": "dev", "contexts": ["blessed_extension", "content_script"] }, chrome/common/extensions/api/_api_features.json
  • 23. How to use let shadow1 = element1.attachShadow({mode: 'open'}); let shadow2 = element2.attachShadow({mode: 'closed'}); element1.shadowRoot === shadow1; // true element2.shadowRoot === null; // true chrome.dom.openOrClosedShadowRoot (element1) === shadow1; // true chrome.dom.openOrClosedShadowRoot (element2) === shadow2; // true
  • 24. Release schedule and future plans
  • 25. Release schedule ● For chrome.tabs.removeCSS on M87 ● For chrome.dom.openOrClosedShadowRoot on M87 / M88
  • 26. Future plans and ongoing work ● Moving forward implementation of new CSS selectors to ease element hiding ○ Working on a prototype for :has() pseudo selector https://github.com/w3c/csswg-drafts/issues/4903 ○ Intent to proto type and ship of :dir() pseudo class (https://chromium-review.googlesource.com/c/chromium/src/+/2460849) ○ Intent to ship complex :not() (https://groups.google.com/a/chromium.org/g/blink-dev/c/0alTkXvDCL8/m/-ClOGv OJBAAJ) ● Ongoing progress on increasing Chromium capabilities for content-blocking useful features as more selectors, or incoming JS spec implementations.