stylish-userstyles / stylish

User styles manager for Firefox and other Mozilla software
https://userstyles.org
GNU General Public License v3.0
546 stars 86 forks source link

Firefox WebExtensions #247

Open Mottie opened 9 years ago

Mottie commented 9 years ago

I don't know if you know, but Firefox is planning to standardize their addons to match Webkit by introducing a new WebExtensions API.

A preview release of WebExtensions is available in Firefox 42, which is currently on Developer Edition...

I was wondering if you had any plans on changing this Firefox addon, and if so, do you have any ideas on a timeline?

The reason I am asking is because a user was requesting use to add a button to toggle an applied Stylish theme, so I created this userscript which, so far, works in Chrome & Opera because the style is injected into the page. It doesn't work in Firefox because the style isn't injected. So, I was just curious :grin:

theres-waldo commented 7 years ago

Note that Mozilla has recently announced that starting in Firefox 57, only WebExtensions will be supported.

Are there plans to convert Stylish into a WebExtension?

jscher2000 commented 7 years ago

Are there plans to convert Stylish into a WebExtension?

As of last June: "the current plan is to toss all of this and use the code from Stylish for Chrome." See: https://github.com/stylish-userstyles/stylish/issues/275#issuecomment-225079880

But since then, we have new owners, so... who knows whether that will happen in a timely manner? And of course it means no ability to style chrome.

BenoitZugmeyer commented 7 years ago

Non-webextensions are completely disabled with the latest Nightly. So I tried to install the Chrome stylish extension, and it seems to work mostly out of the box! That's pretty nice. I think supporting Firefox wouldn't be too complicated.

mikhoul commented 7 years ago

@BenoitZugmeyer Hi just use this addon it's fully compatible and maintained and 100% webext, moreover it's better than Stylish 😸

Link: https://github.com/FirefoxBar/xStyle/releases

Regards :octocat:

BenoitZugmeyer commented 7 years ago

@mikhoul Thanks for sharing, this is great!

JZersche commented 7 years ago

xStyle doesn't parse my code the same as Stylish, and doesn't work with Browser chrome files. I think Stylish is better.

Mottie commented 7 years ago

I would recommend using Stylus - https://github.com/openstyles/stylus

JZersche commented 7 years ago

Stylus doesn't work with Browser chrome files, and has similar issues parsing my code. I just reverted to 52.0b9. Now everything works properly again, yay.

100

jscher2000 commented 7 years ago

Hi JZersche -

xStyle ... doesn't work with Browser chrome files.

Stylus doesn't work with Browser chrome files...

You can generalize that to "WebExtensions cannot style browser chrome" (unless/until a new theming API come to fruition, and even then one should not expect the same freedom offered in the past).

Welcome back to the era of userChrome.css files.

I just reverted to 52.0b9. Now everything works properly again, yay.

An old beta? If you want to use the Firefox 52 branch, try the Extended Support Release, which will continue to receive security updates through next April or so. https://www.mozilla.org/firefox/organizations/all/

mikhoul commented 7 years ago

Hi @JZersche like @jscher2000 said it's not a limitation of xStyle but a limitation of Mozilla/Firefox by not providing the adequate API to apply CSS to the chrome of Firefox for addon.

I've also reverted to using "userChrome.css" to modify the Chrome of Firefox. 🤕

BTW: The style editor of xStyle in one of the best I've seen with Userstyle managers, moreover the dev is very open to suggestions to improve xStyle. Right now I'm working on a french translation 🌍 .

N.B.: xStyle is now available on AMO https://addons.mozilla.org/zh-CN/firefox/addon/xstyle/ but to have the latest signed version it's better to download it from the GitHub repo here: https://github.com/FirefoxBar/xStyle/releases Mozilla take longtime to review addon so there is lot of delay sometime between the submission of an addon on AMO and the availability of the addon.

Stylus is good too but it's a fork of the old code from the Chrome Stylish and xStyle is developed first for Firefox and ported/tested to Chrome after.

Regards :octocat:

Mottie commented 7 years ago

@mikhoul xStyle was also forked from Chrome Stylish (evidence)... I haven't had a chance to check it out.

Update: I tried out the extension and there are still a bunch of issues with it, especially with our GitHub-Dark style. I do like the color picker; but even that is a bit problematic:

mikhoul commented 7 years ago

@Mottie if you see bugs/conflicts with xStyle open an issue and there will be fixed: https://github.com/FirefoxBar/xStyle/issues/new

Regards :octocat:

JZersche commented 7 years ago

It doesn't seem like they have API's with WebExtensions to create new toolbars either. I noticed WebExtensions not only broke Stylish but also the 'The Add-On Bar Restored' extension. Hopefully they.. add additional functionality to WebExtensions. Here's a userstyles.org theme I just made if anywould would like to use it.

https://userstyles.org/styles/147064/userstyles-org-zdark-skin

JohnDDuncanIII commented 7 years ago

So, the webextensions API does not support any internal chrome:// theme-ing, and it is not possible to style scrollbars using the userChrome.css (the only thing I used stylish for). Webextensions seem to severely limit the creative potential and power of old XUL/XPCOM-based extensions; Mozilla is really leaving power users out to dry with this one.

stuaxo commented 7 years ago

It's probably worth contacting them and asking for APIs for what you need.