Обсуждения » Обсуждение сайта Greasy Fork

CSS to UserScript conversion doesn't add @match rules

The vast majority of CSS code on this site and elsewhere doesn't have @match rules in the headers since they already have to use the @-moz-document rule. This means that most UserStyles that GreasyFork converts into UserScripts are showing up globally in people's UserScript extensions. When GreasyFork converts CSS code into a UserScript, it would be very helpful if it could create a @match rule if one doesn't already exist. Or perhaps the uploader could be given a dialog box for adding @match rules when converted. As it is right now, most people use Stylus to write and update their stylesheets, and since its default header doesn't include a @match rule and CSS doesn't require them, the authors will continue to not use them or even know what they are.

Can you provide an example of what you're talking about?

https://greatest.deepsurf.us/en/scripts/454513-youtube-search-results-cleaner

Someone posted that I needed to add a @match rule here because my stylesheet is being applied globally for them.

https://greatest.deepsurf.us/en/scripts/454080-youtube-show-full-view-count-and-date-unless-hovering

This one as well. Is it happening because I have a separate comment block at the top? I just use Stylus for CSS, so I don't have much experience with this stuff.

The converter didn't support multi-line comments at the top like you had. That's been fixed, and now the JS version of your CSS has @includes.

Thanks, Jason. I really appreciate it, along with everything else you're doing.

Ответить

Войдите, чтобы ответить.