You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shadow-dom is being used more and more with webcomponents. It's nifty, it isolates styles and more. The issue is that shadow dom isolates its own styles, and thus ignore a globally-injected stylesheet (and scripts). This makes us unable to re-style nested components inside a shadow dom easily.
It has been an issue for a while with userscripts managers, but it can be solved, this would be a nifty thing to have.
A potential way of doing that would be to check if there are any shadow-dom and inject/replace the stylesheet with ours, but I believe there are more efficients way of doing that.
Injecting arbitrary javascript is trickier, and might lead to unintended side-effect, so it might be better to either provide utility functions or leave it to userscripts developpers.
The text was updated successfully, but these errors were encountered:
CyberFoxar
changed the title
Allow userStyles (and userscripts?) to pierce trough shadow dom elements
[FireMonkey][Feature-Request] Allow userStyles (and userscripts?) to pierce trough shadow dom elements
Apr 4, 2023
As mentioned in FireMonkey Help: addElement, userscripts should be able to inject JavaScript (no GM API), DOM, & CSS into shadow DOM if it is open i.e. {mode: "open"}.
// appending to shadowRootconstelem=GM_addElement(parentElement.shadowRoot,'iframe',{src: 'https://....'});
Feature Request: Pierce Shadow-dom
Shadow-dom is being used more and more with webcomponents. It's nifty, it isolates styles and more. The issue is that shadow dom isolates its own styles, and thus ignore a globally-injected stylesheet (and scripts). This makes us unable to re-style nested components inside a shadow dom easily.
It has been an issue for a while with userscripts managers, but it can be solved, this would be a nifty thing to have.
A potential way of doing that would be to check if there are any shadow-dom and inject/replace the stylesheet with ours, but I believe there are more efficients way of doing that.
Injecting arbitrary javascript is trickier, and might lead to unintended side-effect, so it might be better to either provide utility functions or leave it to userscripts developpers.
The text was updated successfully, but these errors were encountered: