openstyles / stylus

Stylus - Userstyles Manager
https://add0n.com/stylus.html
GNU General Public License v3.0
5.43k stars 304 forks source link

[Firefox] Broken actions #145

Closed unigazer closed 7 years ago

unigazer commented 7 years ago

Hi, I'm having trouble with the Stylus extension. It seems that when I'm about to create a new style, I cannot save the code. It's like the save button has no action.

Stylus 1.1.2.1 Firefox 54.0 (64) Linux Mint 18.2

Also, I'm not even able to import the styles. I've tried backing up the styles from Chrome to Firefox. The dialog prompt appears, I am able to choose the file, and when I choose the backup file .json the cursor just turns into working mode for a long time and nothing happens.

➜  ~ firefox
1502309006863   addons.xpi-utils    
WARN    Synchronous load of XPI database due to getAddonsByType([theme, webextension-theme])
1502309007377   addons.webextension.{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}  
WARN    Please specify whether you want browser_style or not in your browser_action options.
console.error: PushService: 
  stateChangeProcessEnqueue: Error transitioning state
  UnknownError

I've pasted the terminal log anyways, even thought I think this is the problem with the firefox itself, but it might be useful.

narcolepticinsomniac commented 7 years ago

Briefly tested the same exact versions/OS together, and had no issues saving a style. This may be the Firefox bug where setting the browser to "never remember history" (or other similar privacy settings) is incorrectly applied to Stylus, making it pretty much useless. WebExtensions are supposed to be quarantined from these types of settings, but in FF, WebExtensions support is still a work in progress.

If it isn't due to history settings, please test in a clean profile to rule out conflicts with legacy addons. Stylus should also be quarantined from them, but currently it is not.

unigazer commented 7 years ago

Will do so.

unigazer commented 7 years ago

I tried to produce the same things I've tried before, without the sync profile, and ended without results. I see that people aren't reporting this issue, so it's likely a problem with the Firefox itself. Thank you for such a quick response, @narcolepticinsomniac .

narcolepticinsomniac commented 7 years ago

I see that people aren't reporting this issue, so it's likely a problem with the Firefox itself.

No doubt there's a good chance it's a problem with FF itself, but people not reporting the same issue isn't exactly true.

@TayliaM was telling me yesterday she ran into the same thing in 52 ESR, and the latest review on AMO is reporting the same thing in Nightly. Taylia said she didn't chime in because she couldn't figure out any useful steps to repro, only that Stylus had become borked in one profile, and starting a clean profile, it seemed to work again.

So we have similar reports from ESR to Nightly, across different OSes. This sounds similar to the "never remember history" bug, but that doesn't seem to be the case. I haven't been able to reproduce at all.

I tried to produce the same things I've tried before, without the sync profile, and ended without results.

This may be the only decent lead we have on what's causing issues. It seems worth investigating if Sync has something to do with this. I don't have a Sync profile to test, and I never use the sync feature in any browser, so I'm not all that familiar.

anotherusername77 commented 7 years ago

Stylus seems to be not working if Firefox is set on Private Mode (at least, with OSX). Seems to be working if Private Mode is disabled, and styles are correctly loaded... but, turning back on Private Mode, they disappear.

tophf commented 7 years ago

There's no method in WebExtensions API to control FF's private mode so we can't do anything about that. As for FF, I don't know whether this behavior is intended or just another oversight/bug in FF's WebExtensions API integration.

unigazer commented 7 years ago

Now that the extension version is 1.1.3.1, here's what is happening now.

I must note that while the "Manage" tab was open, and then I installed the style, the style itself was shown on the "Manage" tab. However, when I closed the "Manage" tab, and try to re-open it again, the page didn't print the installed styles list, but the styles are working.

narcolepticinsomniac commented 7 years ago

It stands to reason that whatever is causing these issues is also related to some sort of privacy setting. The reason I opened it back up for feedback is that the description of the behavior isn't exactly the same.

@VladimirDev93 Do you have any custom privacy settings at all? These could be in about:preferences#privacy or any custom about:config user settings or any privacy related legacy addons. I know it's a PITA, but can you try disabling all other addons and restarting to rule out conflicts?

The bug with privacy settings is known, and for the time-being, the only solution is not to set strict privacy settings. The behavior you're describing is similar but certainly different. The bottom-line is that there's a few reports that don't sound typical, but we can't reproduce the behavior, so somebody who's experiencing it is gonna have to help get to the bottom of this.

Mottie commented 7 years ago

For me simply setting the about:preferences#privacy History to "Never Remember History" breaks the manage page.

narcolepticinsomniac commented 7 years ago

Yeah, "Never Remember History" breaking the manage page completely is a known bug. The recent reports differed in the fact that everything worked except saving styles. The fact that OP's report now sounds more like the bug we're familiar with, leads me to think this is the same old bug just reported a little differently. I asked OP to check his privacy settings before, but maybe he didn't understand what I was asking. The idea that these settings should affect Stylus the way they do isn't an easy one to wrap your mind around.

unigazer commented 7 years ago

I have never touched this. The only thing I did, is that I've enabled sync on my device. I've tried disabling all other addons, still no results.

Also, the styles can be installed and they are working as I've said, but they are not updating. For example, I know I've changed the code of my style on userstyles.org, and when I click the Check for updates action, the code isn't updating. It only returns No updates found.

PrintScreen_FX

history_fx

unigazer commented 7 years ago

Ignore the Check for updates action not working. Tested again, it works every time, my bad.

But here's an update.

So the "Manage" page is blank. If I click the Check for updates action, it checks for updates and returns the results. This time it returned the result to apply 1 update. After I've clicked the Apply all updates (1), my style appeared on the list.

narcolepticinsomniac commented 7 years ago

I tried enabling sync, and even syncing to a fresh install, I see no difference. Everything works as expected. Thanks for testing with addons disabled. If we can rule out addons and normal privacy settings, the only other variables would be about:config switches. I don't know of any way to revert these besides switching them back individually, manually. Normally, you'd just make a new profile, but that's not gonna help us figure out what's causing the issue here.

unigazer commented 7 years ago

I've updated my code again, and tried to Check for updates to see if the style is going to appear again after I click the Apply all updates (1) action. And it worked as expected, the style showed up on the list.

after

After I closed the tab immediately after updating the style, I've clicked on "Manage" action again, the page appeared blank again.

This is so strange, because on Chrome everything is running perfect.

Mottie commented 7 years ago

Very odd... If I try to execute the following code in the dev tools console on the manage page:

Never remember history

> chrome.extension.getBackgroundPage().getStyles().then(styles => console.log(styles));
Promise { <state>: "pending" }

Remember history

> chrome.extension.getBackgroundPage().getStyles().then(styles => console.log(styles));
Promise { <state>: "pending" }
Array []

It seems like the Promise never resolves.

narcolepticinsomniac commented 7 years ago

A few questions. Do you have any custom about:config settings? Since you say updates are in fact working, does that mean saving edits are working as well?

Why are these manager filters active in your screenshot?

manage

narcolepticinsomniac commented 7 years ago

Very odd

Yeah, but it's old news. I'm really just trying to figure out if there's something different going on here, but the details keep changing.

unigazer commented 7 years ago

Those filters where toggled on once I've installed the extension. The only thing I do with the extension, is creating new styles, modifying locally before publishing on userstyles.org, and that's it. I've never tweaked the about:config in Firefox.

unigazer commented 7 years ago

I've toggled that filter off, and the styles showed up. All of them!

I swear, I didn't touch anything regarding to those filters.

narcolepticinsomniac commented 7 years ago

Jesus. Mystery solved. NBD Vlad. Glad you got it working again.

tophf commented 7 years ago

Obviously our UI is not as obvious as we thought. We need to show that filtering is active more prominently. For example, n styles hidden by the applied filters before or after list.

tophf commented 7 years ago

1-fs8 @narcolepticinsomniac, WDYT?

narcolepticinsomniac commented 7 years ago

Yeah, LGTM. I'd rather avoid going down that rabbit hole again in the future. I should've caught on sooner, but it was FF, and the report was originally about functionality issues similar to the FF privacy settings bug, so I was already thinking along those lines.

tophf commented 7 years ago

Added, please test: filters-stats.zip

narcolepticinsomniac commented 7 years ago

Looks good. To nitpick, I've never been a fan of ambiguous plurality, but if having a separate message for "1 style" is a PITA, it's fine.

Not sure if a colon would be more appropriate either. I don't particularly care, but we swapped a similar hyphen recently.

tophf commented 7 years ago

I'll switch to a colon then. As for (s) we would have to offer 3 or 4 plural cases for other languages that change inflection/suffix depending on the last digit like 1, 2-4, 5+ etc.

narcolepticinsomniac commented 7 years ago

we would have to offer 3 or 4 plural cases for other languages that change inflection/suffix depending on the last digit

Wasn't aware of this. Does (s) actually translate better? If so, it's fine. Since "Installed Styles" is already the header above, we could also probably lose it altogether, like: Filters: 11 currently shown of 200 total. Either is fine really.

tophf commented 7 years ago

Implemented in f001bca849cb9d63a0349d4a45a5e820ebd34b36 as Filters: 11 shown of 111 total

baflove47 commented 6 years ago

[] Please wait as BeEF services are started. [] You might need to refresh your browser once it opens. [] UI URL: http://127.0.0.1:3000/ui/panel [] Hook: [*] Example: root@bako47:~# console.error: PushService: stateChangeProcessEnqueue: Error transitioning state UnknownError

tophf commented 6 years ago

@baflove47 those aren't our scripts.