openstyles / stylus

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

[Bug] Edited Styles get applied to every domain #1597

Closed handsomelancer closed 1 year ago

handsomelancer commented 1 year ago

Bug Report

Bug Description

Whenever i edit a UC style it gets applied to all other websites as well.

Screenshots

Style for satckoverflow being applied to GitHub as well

Screenshot from 2023-05-10 16-47-57

CSS Code

Just for example, following gets applied to all websites instead of just StackOverflow

/* ==UserStyle==
@name           StackOverflow - Atom One Dark
@namespace      USO Archive
@author         tekami
@description    `A StackOverflow theme based on the popular Atom One Dark theme.`
@version        20230508.21.11
@license        CC-BY-4.0
@preprocessor   uso
==/UserStyle== */

/* My edit */
.js-consent-banner {
    display: none;
}

/* The actual style code starts here */
@-moz-document domain("stackoverflow.com") {
    html {
        ...

System Information

Additional Context

I have tried removing my edits and then it works as it should, i.e., the styles gets applied to only the described domains. Then if i edit them again, the same happens, it gets applied to all other websites as well.

I have tried restarting Firefox after the edits but still the same issue.

pabli24 commented 1 year ago

You need to put your edits inside the @-moz-document domain("stackoverflow.com") otherwise your edit is global and applied everywhere


@-moz-document domain("stackoverflow.com") {
/* My edit */
.js-consent-banner {
    display: none;
}

    html {
        ...

Its also better to make a completely separate style for your edits so the main style can be still updated by the original author without any problems