feat(core): expand compatibility for multiple style extensions
This update significantly enhances the script to support a wider range of
user style extensions and injection methods.
Broader Extension Support: The CSS selector in syncStyles
is expanded
to find style tags from Stylish, Stylebot, Magic CSS, xStyle, and more,
not just .stylus
.
document.adoptedStyleSheets
Syncing: Adds support for extensions (like
modern Stylus) that inject styles directly via adoptedStyleSheets
.
- Patches
Document.prototype.adoptedStyleSheets
to detect changes.
- A new
syncAdoptedStyles
function copies relevant rules into a
separate CSSStyleSheet
(sheetInDoc
), which is then propagated
to all shadow roots.