openstyles / stylus

Stylus - Userstyles Manager
https://add0n.com/stylus.html
GNU General Public License v3.0
5.32k stars 300 forks source link

[Bug] Stylus breaks sites made with caseme.io (using React) #1803

Open fireattack opened 1 month ago

fireattack commented 1 month ago

Bug Report

Bug Description

Injecting any rule, even the ones will not match, would break any websites built with this caseme.io service, including their homepage: https://caseme.io/ (I originally found this bug when visiting another site, https://roitman.io/blog/91.)

There are bunch of errors in console from React:

chunk-WARRYLZU.js:6 Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at jo (chunk-WARRYLZU.js:6:5244)
    at Dh (chunk-WARRYLZU.js:8:15317)
    at Bd (chunk-WARRYLZU.js:8:39835)
    at Wd (chunk-WARRYLZU.js:8:39592)
    at Hh (chunk-WARRYLZU.js:8:39504)
    at $d (chunk-WARRYLZU.js:8:34562)
    at pi (chunk-WARRYLZU.js:1:28990)
    at MessagePort.si (chunk-WARRYLZU.js:1:29381)
chunk-WARRYLZU.js:8 Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at pu (chunk-WARRYLZU.js:6:4788)
    at Qd (chunk-WARRYLZU.js:8:45306)
    at Wd (chunk-WARRYLZU.js:8:39531)
    at Hh (chunk-WARRYLZU.js:8:39504)
    at $d (chunk-WARRYLZU.js:8:34562)
    at pi (chunk-WARRYLZU.js:1:28990)
    at MessagePort.si (chunk-WARRYLZU.js:1:29381)
chunk-WARRYLZU.js:6 Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at pu (chunk-WARRYLZU.js:6:4788)
    at Qd (chunk-WARRYLZU.js:8:45306)
    at Wd (chunk-WARRYLZU.js:8:39531)
    at Hh (chunk-WARRYLZU.js:8:39504)
    at $d (chunk-WARRYLZU.js:8:34562)
    at pi (chunk-WARRYLZU.js:1:28990)
    at MessagePort.si (chunk-WARRYLZU.js:1:29381)
chunk-WARRYLZU.js:8 Uncaught Error: Minified React error #423; visit https://reactjs.org/docs/error-decoder.html?invariant=423 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at Qd (chunk-WARRYLZU.js:8:44966)
    at Wd (chunk-WARRYLZU.js:8:39531)
    at Bh (chunk-WARRYLZU.js:8:39462)
    at vl (chunk-WARRYLZU.js:8:39321)
    at Ou (chunk-WARRYLZU.js:8:35739)
    at $d (chunk-WARRYLZU.js:8:34695)
    at pi (chunk-WARRYLZU.js:1:28990)
    at MessagePort.si (chunk-WARRYLZU.js:1:29381)

Screenshots

image

image

CSS Code

Any rule would break it. E.g.

@-moz-document domain("caseme.io") {
dummy > rule {
    display: none;
}
}

System Information

Additional Context

tophf commented 1 month ago

The site explicitly throws on any foreign element added under <html> node. It's the first time I see such a site. As a workaround you can enable Circumvent CSP 'style-­src' via adoptedSty­leSheets in the options.