Go to file
Your Name 2016c0ed42 Fix #1176 Installing local UserCSS style fails in Firefox
Following discussion in #1176 I've used `git bisect` to find the first
failing commit as @tophf suggested. Starting from last good version `v1.5.13`
reported by @vednoc I've arrived at commit 707cd6576f
as the first bad commit.

From what I was able to get reading the code and reproducing the error state
shown on [screenshot from original report](https://user-images.githubusercontent.com/18245694/107519428-8da8d400-6bb0-11eb-8df0-740161ec7c88.png),
it looks like the error comes from changing the logic in `downloadSelf`
event listener.

Old code used this condition for determining when to fill in `code`
value of the msg passed:

```
.then(code => ({id, code: timer && code === self.oldCode ? null : code}))
```

while new logic uses something like this (note the use of `force` flag
instead of `timer` and somewhat inverse nature of the logic):

```
.then(code => ({id, code: force || code !== self.oldCode ? code : null}))
```

What this patch does is applying both approaches: using `force` flag and
using `timer` flag at the same time. As I am myself affected by this
bug, and was able to successfully mitigate it in my environment (latest
FireFox v87.0 on Linux), I can confirm that it solves the issue and now
I'm able to install local files on FireFox again with this patch.

Please let me know if this pull request needs more formatting or
additional commits, as the
[contributions page](https://github.com/openstyles/stylus/blob/master/.github/CONTRIBUTING.md#pull-requests)
didn't mention anything specific aside from `.editorconfig` codestyle which I
think I didn't break here.

P.S.: There's a 39c1d61e11b78d5343218591ac7f5848cb3e82bb commit which
claims to fix #1176 as well, but according to my tests it doesn't make
much difference to help the bug and didn't actually solve it.
2021-04-07 22:42:21 +02:00
_locales show unreachableMozSiteHint on any site in FF 2021-03-12 08:51:57 +03:00
.github Simplify CI action 2020-10-30 08:22:53 +03:00
.tx Locales (#532) 2018-11-03 09:37:25 -05:00
background print stylus-lang's p() to editor console, fixes #894 2021-03-14 10:07:59 +03:00
content Fix #1176 Installing local UserCSS style fails in Firefox 2021-04-07 22:42:21 +02:00
edit fix editor theme in FF containers, fixes #1222 2021-04-06 06:56:35 +03:00
images/icon remove what-input, use own implementation, rebase on master 2017-12-13 03:27:10 +03:00
install-usercss revert 4ae2c670's changes for the install button 2021-03-19 23:02:02 +03:00
js reimplement #1192 using dummy links 2021-03-19 22:53:52 +03:00
manage show time/weekday in tooltip for style entries (#1205) 2021-03-11 07:20:38 +03:00
options unbork install button style + dedupe svg-icon 2021-03-06 21:22:24 +03:00
popup reimplement #1192 using dummy links 2021-03-19 22:53:52 +03:00
tools add a test for the transition suppressor rule 2021-03-09 19:24:37 +03:00
vendor CodeMirror 5.60.0 2021-03-20 14:23:49 +03:00
vendor-overwrites API groups + use executeScript for early injection (#1149) 2021-01-01 17:27:58 +03:00
.editorconfig Don't enforce non-native end_of_line in editorconfig 2017-04-18 12:43:30 +03:00
.eslintignore API groups + use executeScript for early injection (#1149) 2021-01-01 17:27:58 +03:00
.eslintrc.yml enforce eslint radix rule for parseInt 2021-02-26 13:02:54 +03:00
.gitattributes Locales (#532) 2018-11-03 09:37:25 -05:00
.gitignore Account for Dropbox bug (#833) 2020-02-02 09:02:25 -05:00
BUILD.md README: update build instructions 2020-02-16 11:08:24 -06:00
edit.html fixup: load codemirror-themes.js earlier 2021-04-06 07:10:03 +03:00
global.css reimplement #1192 using dummy links 2021-03-19 22:53:52 +03:00
install-usercss.html API groups + use executeScript for early injection (#1149) 2021-01-01 17:27:58 +03:00
LICENSE Adding external licenses (#424) 2018-07-09 16:39:31 +03:00
manage.html reimplement #1192 using dummy links 2021-03-19 22:53:52 +03:00
manifest.json relaxed parsing of usercss @version 2021-02-26 10:03:32 +03:00
options.html reimplement #1192 using dummy links 2021-03-19 22:53:52 +03:00
package-lock.json CodeMirror 5.60.0 2021-03-20 14:23:49 +03:00
package.json CodeMirror 5.60.0 2021-03-20 14:23:49 +03:00
popup.html reimplement #1192 using dummy links 2021-03-19 22:53:52 +03:00
README.md shrink screenshots to make readme readmeable 2021-02-25 10:26:32 +03:00

Stylus

Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExtension

Highlights

  • In addition to the userstyles.org site, styles with customizable parameters can also be installed from .user.css or .user.styl URLs (see Usercss format wiki).
  • Site styles can be discovered and previewed in the popup using inline search with screenshot thumbnails.
  • A backup feature which is compatible with other userstyles managers.
  • Configurable automatic update function for installed styles.
  • Customizable UI, optional layouts, and tweaks.
  • Two different optional code validators with user-configurable rules: CSSLint and Stylelint.
    • Both validators use Web Worker API to run in a separate background thread inside the editor tab without blocking your interaction with the code.
    • CSSLint is heavily modified compared to the effectively frozen original one and supports various CSS3 features as well as CSS4 Color and CSS Grid syntax.

Releases

  1. Chrome Web Store (or beta)
  2. Firefox add-ons
  3. Opera add-ons (see wiki for more recent version)

Screenshots

Manager Editor Popup search Popup config Manager config Options
Style manager Style editor Popup inline search Popup config for usercss Style manager config for usercss Options

Help

Contributing

The source is hosted on GitHub and pull requests are welcome.

You can help us translate the extension on Transifex.

See our contributing page for more details.

License

Inherited code from the original Stylish:

Copyright © 2005-2014 Jason Barnabe

Current Stylus:

Copyright © 2017-2019 Stylus Team

GNU GPLv3

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

External libraries

The licenses of external libraries used in this project or modified versions of external libraries can be found in their respective directory.