-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GM_addStyle does not work with the shadow DOM #1059
Comments
You can override attachShadow prototype in the page by using |
@tophf
|
Can someone guide me some hints on how to adapt a very simple extension that just used GM_addStyle() to bypass this? I suspect that reason why it fails to inject the styles is due to shadow use. |
@ssbarnea Please see #881 (comment) |
Expected Behavior
work with the shadow DOM
https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow
Actual Behavior
not work with the shadow DOM
Specifications
I wrote a script that uses element.attachShadow(), but encountered a restriction in Content-Security-Policy, which prevented the CSS style file from loading, and GM_addStyle doesn't work under shadow DOM. Because the style is complex, I don't want to interfere with the page, so I use shadow DOM.
Script address:
https://greasyfork.org/en/scripts/376313-%E5%88%92%E8%AF%8D%E7%BF%BB%E8%AF%91-%E5%A4%9A%E8%AF%8D%E5%85%B8%E6%9F%A5%E8%AF%A2
https://greasyfork.org/en/scripts/34921-translate
Website restricted by CSP: https://www.gimp.org/
The text was updated successfully, but these errors were encountered: