NiklasGollenstede / re-style

A user style manager for Firefox 57+ which can load local files and apply UI styles
https://addons.mozilla.org/addon/re-style/
Mozilla Public License 2.0
38 stars 4 forks source link

Styles fail to install if the server doesn't sent "text/css" as content type #1

Closed NiklasGollenstede closed 6 years ago

NiklasGollenstede commented 6 years ago

This causes:

when installing one, I still get an error (even though it will get listed to my styles): SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

https://github.com/NiklasGollenstede/native-ext/issues/2#issuecomment-340141459

NiklasGollenstede commented 6 years ago

I tried these styles, by the way.

I have't looked through all of them, but as it says in the repo description, they are userChrome snippets, not stylish styles. reStyle is meant as a replacement for Stylish and requires @document sections to know where to put the different kinds of styles. Without them, the only thing reStyle could do would be to apply the style to the UI, about:-pages and every web page. That is usually not what you actually want and would be very inefficient. Most of the styles in the linked repo should actually be surrounded with this (even when directly pasted to the userChrome.css file):

@-moz-document
    url(chrome://browser/content/browser.xul)
{
    /* css from file here */
}

Without a surrounding @document rule (or a @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");), reSytle will not recognize a style as a UI style.

NiklasGollenstede commented 6 years ago

The problem itself is fixed in 89ac2e1cbbfc49c86ecae3378b2eb02abf02df89. I'll update the beta on AMO.