4 ms·
I had never considered this before. Would Shadow DOM make browser plugins like Stylish useless against horribly layed out websites? There has to be a work arou
by RobertRoberts 8y ago
I had never considered this before. Would Shadow DOM make browser plugins like Stylish useless against horribly layed out websites?
There has to be a work around for this issue...
- JeremyBanks 8y agoIt used to be possible to write "shadow-piercing" CSS selectors, but this capability was removed for making it too easy to violate the encapsulation. (And indeed, I saw it frequently used to accommodate misuse of the Shadow DOM API.) https://developers.google.com/web/updates/2017/10/remove-shadow-piercing https://developers.google.com/web/updates/2017/10/remove-sha... It sounds like "Shadow Parts" will let you target subcomponents in some Shadow DOMs, once it's implemented, but I'm afraid that's probably not going to help you with misbehaving websites.
- rictic 8y agoStill definitely possible for browser plugins to do anything they want to Shadow DOM. For open shadow roots, javascript can crawl them. If handling closed shadow trees is necessary, just patch Element.prototype.attachShadow and keep a WeakMap from the Element instance to its shadow root.