userstyles-world / userstyles.world

⭐ Website to browse and share UserCSS userstyles. A modern replacement for UserStyles.org made by the userstyles community.
https://userstyles.world
GNU Affero General Public License v3.0
323 stars 15 forks source link

Add a way to install with Stylish addon too #64

Closed decembre closed 3 years ago

decembre commented 3 years ago

It was an request i doing at the beginning of USw. And you reply to me it was not trivial to do and maybe not so useful. But sorry, i think, if it is possible, it should be interesting to reopen the request.

Since a long time Stylus don't want install an userstyles with Waterfox Classic. When i try , i have always this error msg: "Stylus a échoué à parser le usercss : invalid regexp group:"

I report it to the Stylus team and Waterfox .... but without results at this time: Just they said they "can fix it".... but when, i don't know.

So i can't test other usestyles into Waterfox Classic because of that.

If it is a problem for me, it can be too for others users of Waterfox Classic.

Yes, if Stylus is better than Stylish (functions and privacy), it don't work with Waterfox Classic when we want install an userstyle from USw. It only work when we create an new userstyles, that's all.

So, to gain more users to USw and preserve compatibility, Add an install with Stylish (mine is a version without privacy problem) should be great.

How to do ?: If remember well, the userstyles.org site, for the install of userstyle which provide variables / options (not just simple CSS), we can chose between them and after install it. I rarely use them but that's was fine.

Can you do the same thing on USw ? If before installation, when need a Stylish install, we can access to the config of these type of userstyles and choose them, it should be famous. For a simple userstyle (with no options/variables, like mine): A direct install by Stylish too should be possible.

PS: I have tested to copy / paste the CSS code of Userstyle with Stylus configuration inside (sorry if it is confused): It need many works to make it work a little bit: remove the top header, all "if" sections (but keep some and rewrite them in normal CSS format , etc.... To much work by hand.

vednoc commented 3 years ago

The developers of Stylish extension would have to implement support for USw on their own. We can't do anything about that.

Since a long time Stylus don't want install an userstyles with Waterfox Classic.

There's an open PR that fixes the mentioned issue: https://github.com/openstyles/usercss-meta/pull/74

Give them a ping so that they don't forget to merge it for the next release. Beta release is supposed to go live soon in order to test USw integration as well as other bug fixes, but that's all I've been told.

Also, I can't wait for a new release in order to stop loading changes from the latest master branch whenever I want to write userstyles with an external editor. That functionality was broken only in Firefox with the latest v1.5.17 release.

If it is a problem for me, it can be too for others users of Waterfox Classic.

Indeed, but they don't seem to be vocal about it. Unfortunately, it is what it is until the bug is fixed. Have you tried installing one of the previous versions of Stylus? If not, make sure you export a backup of your userstyles first.

Can you do the same thing on USw ?

Even if we tried to do so, Stylish still wouldn't be able to install userstyles from USw because of two reasons:

  1. It would only work with default preprocessor. No LessCSS, no Stylus-lang – those are separate languages that compile to CSS.
  2. Stylish is hard-coded to only talk to USo's API. It can't be changed without modifying the source code. Even so, the source code for pre-spyware version of Stylish is very different to that of Stylus, and spyware version of Stylish is closed source.

I have tested to copy / paste the CSS code of Userstyle with Stylus configuration inside (sorry if it is confused):

You can only do so for userstyles that use default processor. Just make a new userstyle (with "as Usercss" checkbox disabled), then click on "Import" button, paste the code, remove UserStyle metadata header, and you'll have a working userstyle. I tested this with a couple of your userstyles and everything works as intended.

remove the top header, all "if" sections (but keep some and rewrite them in normal CSS format , etc....

And that's the problem: by doing that, it defeats the purpose of using preprocessors and UserCSS format. I ship some of my userstyles with both Stylus-lang and default prepcessor, the latter of which can be imported like I mentioned in the previous section. As an example, have a look at either one of my GitLab/WhatsApp/Instagram userstyles to see how it's done.

decembre commented 3 years ago

Thanks for your quick reply, as uasual.

Make a new userstyle (with "as Usercss" checkbox disabled), then click on "Import" button, paste the code, remove UserStyle metadata header, and you'll have a working userstyle. I tested this with a couple of your userstyles and everything works as intended.

Good trick, I don' thinks to that...

Give them a ping so that they don't forget to merge it for the next release

I do it

Even if we tried to do so, Stylish still wouldn't be able to install userstyles from USw because... Booh... that's good, with your trick and some time and a Stylus fix, all should be good.

Anyway, good evolution to your site: You hard work on it as i can see;

vednoc commented 3 years ago

Let me know if there's anything left unclear.

Anyway, good evolution to your site: You hard work on it as i can see;

Don't forget @Gusted's hard work, too. That combined with feedback from the community is what makes this project a team effort. It's going to be an exciting month ahead of us, as we get closer to feature parity with other platforms.

Gusted commented 3 years ago

Don't forget @Gusted's hard work, too.

My dog does typing and coding, and I troll Mikey all the time and annoy him.

Gusted commented 3 years ago

Is this considered fixed? As next stylus release, contain the fix.

vednoc commented 3 years ago

Just tested Waterfox and everything seems to be working correctly. 🎉