[Release] Stylem

General discussion, compatibility and contributed extensions.

Moderators: FranklinDM, Lootyhoof

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1055
Joined: 2017-06-06, 07:38

Re: [Release] Stylem

Post by adesh » 2019-12-04, 12:04

You don't need "http" bit in domain.

User avatar
lunario
Moongazer
Moongazer
Posts: 10
Joined: 2019-12-01, 20:25

Re: [Release] Stylem

Post by lunario » 2019-12-04, 16:31

Thank you, but even without that bit it won't work

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2240
Joined: 2015-09-26, 04:51
Location: U.S.

Re: [Release] Stylem

Post by coffeebreak » 2019-12-04, 21:48

lunario wrote:
2019-12-04, 10:26
the goal being to have grayscale on all sites except openstreetmap as it breaks the layout
I don't know regex and couldn't figure out how to remove "http" entirely, but changing the http in your expression to https seems to do what you want.
(openstreetmap.org appears to use https exclusively with no fallback to http.)

Code: Select all

@-moz-document regexp('(?!https://www\\.openstreetmap\\.org).*') {
html {
  filter: grayscale(100%);
}
}
This worked also:

Code: Select all

@-moz-document regexp('(?!(http|https)://www\\.openstreetmap\\.org).*') {
html {
  filter: grayscale(100%);
}
}

User avatar
lunario
Moongazer
Moongazer
Posts: 10
Joined: 2019-12-01, 20:25

Re: [Release] Stylem

Post by lunario » 2019-12-05, 08:41

Thanks a lot!

Lew Rockwell Fan
Fanatic
Fanatic
Posts: 190
Joined: 2017-06-14, 15:20

Re: [Release] Stylem

Post by Lew Rockwell Fan » 2020-02-05, 18:19

Is this the place to post feature suggestions?
I have one, based on the Ffx extension "Stylus" (which you might want to look at it and run on Ffx a bit just to get a feel for the UI).

- On a drop down menu from the toolbar icon, under sub-menus for each theme active on that page, add some items:
1. Exclude this domain
2. Exclude this url
3. Exclude regex based on this url, which would open a regex edit window with the url text already in the editor, along with some regex examples.
4. Clone & Edit with External Editor - which would first ask you for the name of the new version, then create it and open it with the editor set in prefs.
5. Rename this theme.
6. Delete this theme.

"Stylus" has the first 2 of these, and although I've persistently experimented a lot with all similar extensions I've found over years with both PM and Ffx, it is the first I've found better for me than the plain old "toggle colors" button, specifically because of these 2 features.

They let me use a global theme as a default and easily except domains or pages. The only way to do this otherwise is hand editing the global theme and using regexes. While that can work, it's way too tedious to be practical, at least for us mere mortals who do regexes by iteration of a try-fail-try-fail cycle about eleventy-seven times before succeeding. As I exclude more websites by manual editing, those regexes grow longer and longer and harder to read. So I pretty much gave up on theming extensions (I'm just using the toggle colors button on PM now) before I tried Stylus, and that's what made the difference. I'm not dissing your effort with Stylem - it's better than Stylish, but, for me, this, with at least the first 2 items, would make it practical.
"To attempt to silence a man is to pay him homage, for it is an acknowledgement that his arguments are both impossible to answer and impossible to ignore." - John Bryant

vannilla
Board Warrior
Board Warrior
Posts: 1005
Joined: 2018-05-05, 13:29

Re: [Release] Stylem

Post by vannilla » 2020-02-09, 13:49

Stylem always throws an error when starting, when it tries to access the extension with ID "{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}".
Since the "addon" argument passed to the callback is an actual object only when that extension is installed, would it be possible to place a guard against null/undefined values, so as to not print any error message in the console?
Something like:

Code: Select all

if (!addon) {
  return;
}
Always seeing that error is a bit annoying and some times I was tricked by it while troubleshooting some unrelated issues.
Thanks.

User avatar
Lootyhoof
Themeist
Themeist
Posts: 1433
Joined: 2012-02-09, 23:35
Location: United Kingdom

Re: [Release] Stylem

Post by Lootyhoof » 2020-02-09, 14:26

vannilla wrote:
2020-02-09, 13:49
Stylem always throws an error when starting, when it tries to access the extension with ID "{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}".
Since the "addon" argument passed to the callback is an actual object only when that extension is installed, would it be possible to place a guard against null/undefined values, so as to not print any error message in the console?
This is the check Stylem performs to make sure that Stylish is not currently enabled (as the two will clash). Unfortunately, it seems that returning from that function will still log to console in your case, as the extension does not exist. I'm also not aware of a more elegant way to check for the extension's existence.

User avatar
JustOff
Localization Coordinator
Localization Coordinator
Posts: 1968
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Re: [Release] Stylem

Post by JustOff » 2020-02-09, 14:53

Sorry, but may I ask what made you make this change? There were no errors before that.
Here are the add-ons I made in a spare time. That was fun!

User avatar
Lootyhoof
Themeist
Themeist
Posts: 1433
Joined: 2012-02-09, 23:35
Location: United Kingdom

Re: [Release] Stylem

Post by Lootyhoof » 2020-02-09, 14:57

JustOff wrote:
2020-02-09, 14:53
Sorry, but may I ask what made you make this change? There were no errors before that.
I integrated the patch from here, to make it behave better on other applications.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 27078
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: [Release] Stylem

Post by Moonchild » 2020-02-09, 15:00

JustOff wrote:
2020-02-09, 14:53
Sorry, but may I ask what made you make this change? There were no errors before that.
Checking the pref isn't really a reliable way to check the states of add-ons, IIUC.

As for the console error, why not simply use a try/catch instead?
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

vannilla
Board Warrior
Board Warrior
Posts: 1005
Joined: 2018-05-05, 13:29

Re: [Release] Stylem

Post by vannilla » 2020-02-09, 15:06

Lootyhoof wrote:
2020-02-09, 14:26
This is the check Stylem performs to make sure that Stylish is not currently enabled (as the two will clash). Unfortunately, it seems that returning from that function will still log to console in your case, as the extension does not exist. I'm also not aware of a more elegant way to check for the extension's existence.
The error message I get is that "addon" is null on line 23. In that line the code tries to access "userDisabled", but since "addon" is null it generates an error.
Actually I haven't tried the fix(?) myself so I don't know what happens, but I suppose anything else than a stacktrace might at least make the error clearer that it's from Stylem snd not the browser/the website.

User avatar
JustOff
Localization Coordinator
Localization Coordinator
Posts: 1968
Joined: 2015-09-03, 19:47
Location: UA
Contact:

Re: [Release] Stylem

Post by JustOff » 2020-02-09, 15:14

Moonchild wrote:
2020-02-09, 15:00
JustOff wrote:
2020-02-09, 14:53
Sorry, but may I ask what made you make this change? There were no errors before that.
Checking the pref isn't really a reliable way to check the states of add-ons, IIUC.
It works great for classic XUL extensions, but not for bootstrap ones, not to mention WebExtensions, if that version of Stylish caused the issue in Waterfox.

Lootyhoof wrote:
2020-02-09, 14:57
I integrated the patch from here, to make it behave better on other applications.
Thank you, I'll try to offer you a more accurate check for all browsers you support. Perhaps even "if (!addon || addon.userDisabled)" is enough.
Here are the add-ons I made in a spare time. That was fun!

User avatar
Lootyhoof
Themeist
Themeist
Posts: 1433
Joined: 2012-02-09, 23:35
Location: United Kingdom

Re: [Release] Stylem

Post by Lootyhoof » 2020-04-07, 16:25

Stylem has been updated to v2.2.6.

What's new?
- change first run URL to be the repository's wiki
- revert disabler change from 2.2.5
- adjust supported applications
- minor CSS cleanup

JustOff wrote:
2020-02-09, 15:14
I'll try to offer you a more accurate check for all browsers you support.
I dropped Waterfox support, so I reverted this anyway.

User avatar
back2themoon
Board Warrior
Board Warrior
Posts: 1724
Joined: 2012-08-19, 20:32

Re: [Release] Stylem

Post by back2themoon » 2020-04-26, 10:03

Thank you for the wonderful Stlylem! If possible, please consider adding a configurable shortcut for toggling "Turn all styles on".
Safe Mode / clean profile info: Help/Restart in Safe Mode
Information to include when asking for support - How to apply user agent overrides
How to download videos

Windows 10 Pro • Pale Moon x64 • Interlink x64 • Emsisoft Anti-Malware

User avatar
back2themoon
Board Warrior
Board Warrior
Posts: 1724
Joined: 2012-08-19, 20:32

Re: [Release] Stylem

Post by back2themoon » 2020-04-29, 09:10

For the keyboard shortcut, this solution is easy and works. Just use the code below instead, in step 6:

Code: Select all

let prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
let key = 'extensions.stylem.styleRegistrationEnabled';
prefs.setBoolPref(key, ! prefs.getBoolPref(key));
Safe Mode / clean profile info: Help/Restart in Safe Mode
Information to include when asking for support - How to apply user agent overrides
How to download videos

Windows 10 Pro • Pale Moon x64 • Interlink x64 • Emsisoft Anti-Malware

Post Reply