Greasy Fork is available in English.

讨论 » Greasy Fork 反馈

@ include - Problem de convertion for CSS to JS ?

§
发表于:2022-08-27

REF:
Help: Prolem with include in my userscript (userstyle)

When i try to instal this userscript(CSS only) as Userscript and not userstyle, the include became :
@ include *
so it applies to all sites, that does not be the case.
Why ?

JasonBarnabe管理员
§
发表于:2022-08-27

The reason is because you have

@namespace url(http://www.w3.org/1999/xhtml);

outside of any @-moz-document, so it wants to apply that globally. I will see if I can fix it, but until then, you can simply remove this declaration.

§
发表于:2022-08-28

Haa ok!
Thanks for the explanation...

§
发表于:2022-08-28

Another same problem with:
X NudeVista - Widescreen Black Them Tweak

It applies to all pages.
And i don't see in it any :
@namespace url(http://www.w3.org/1999/xhtml);

§
发表于:2022-08-28
编辑于:2022-08-28

And @include with regexp seems have problem too...
Note
Some userstyles need the :
/* AGENT_SHEET */
@namespace url(http://www.w3.org/1999/xhtml);

to can override the site page

JasonBarnabe管理员
§
发表于:2022-08-29

I've put in a fix that should prevent it from making it global when there's an `@namespace`.

JasonBarnabe管理员
§
发表于:2022-08-29

Another same problem with:
X NudeVista - Widescreen Black Them Tweak

The problem there is due to this code:

/* URL-PREF - URL - NUDEVISTA HOME + SEARCH START */
/* @-moz-document url-prefix("https://www.nudevista.com/")  */

The site is not actually properly parsing CSS - it's just looking for the String @-moz-document, so this comment confuses it. Taking it out should solve the issue.

§
发表于:2022-08-29
编辑于:2022-08-29

Tanks a lot for the solution!
Now that's good ....
:-)

But stay pb for regexp ?
By example with (which applies to all sites):
Google Search Expand Options
Haa... sorry, that's the:
@namespace url("http://www.w3.org/1999/xhtml");

But this one have no pb with regexp:
GitHub Red Issues

JasonBarnabe管理员
§
发表于:2022-08-29
But stay pb for regexp ?
By example with (which applies to all sites):
Google Search Expand Options
Haa... sorry, that's the:
@namespace url("http://www.w3.org/1999/xhtml");

This is actually the @charset now. I need to update my fix to handle that as well.

§
发表于:2022-08-29

Ha...
Sorry to give to you more work!

Note, outside the @include pb:
To test how work others Userscripts>CSS,
I had make a advanced search with "regxp" in code .
I wanted filter to see only CSS:
Seems not possible:
Always show the label "JavaScript" highlighting.
And seems not changes the results provided.
Tested without userscripts enable on Waterfox.

JasonBarnabe管理员
§
发表于:2022-08-30

@charset issue is fixed.

§
发表于:2022-08-30

ok

§
发表于:2022-09-15

In an userstyle to style an svg, i need to add (without it i can't style the svg):
@namespace svg "http://www.w3.org/2000/svg";

1 - How to add it with my "normal" name space - @namespace url(http://www.w3.org/1999/xhtml);?

2 - How your wrapper can match "@namespace svg "http://www.w3.org/2000/svg";" ?

§
发表于:2022-10-19

Other problems for these userscripts...(not working with install as userscript but work with Stylus)...

Mine:
Invidious (All Instances) Player And Tabs
Other:
Better Icons for Invidious (My feedback about that)

What's the problem ?

JasonBarnabe管理员
§
发表于:2022-10-20
Invidious (All Instances) Player And Tabs

Generated JS code looks fine to me. Not sure why it wouldn't work.

§
发表于:2022-10-21

The author of "Better Icons for Invidious" say it work with greasemonkey 4.1 (the last updated version of it).
So, maybe it's a problem with greasemonkey 3.17 i use?

§
发表于:2022-10-21

Tested with Tampermonkey:
All is fine.
So the problem is greasemonkey 3.xx version.

发表回复

登录以发表回复。