Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] v2.0.8 seems to randomly fail to apply styles or open Stylus manage settings #1861

Open
chocmake opened this issue Dec 24, 2024 · 5 comments

Comments

@chocmake
Copy link

chocmake commented Dec 24, 2024

Bug Report

Bug Description

With one of my Linux installs in the last day (seems to match when Stylus was last updated) I noticed in Vivaldi browser that userstyles randomly have not applied to sites, also causing the Stylus button to not present its menu when clicked nor the userstyle manager able to be opened.

A restart of the browser resolves the issue before it randomly occurs again during some point of the open session.

System Information

  • OS: Linux (Kubuntu)
  • Stylus version: 2.0.8
  • Browser: Vivaldi 6.9.3447.48 (Chromium 128)
@tophf
Copy link
Member

tophf commented Dec 24, 2024

I can't reproduce the problem, but it sounds like there's an error in the background service worker.

  1. open chrome://extensions
  2. enable Developer mode switch in the top right corner
  3. Click Service worker in Stylus card
  4. Switch to the console tab in the devtools window that opens, and copy the errors here if there are any.

If there are none, click Details button, then enable Collect errors. When an error occurs it will be shown in the extension's card in chrome://extensions page. There will be one warning that is safe to ignore: 'webRequestBlocking' requires manifest version of 2 or lower.

@chocmake
Copy link
Author

chocmake commented Dec 25, 2024

So after testing with the dev mode and service worker + collect errors enabled I couldn't reproduce it after many hours and various browser sessions. While during the initial half day when I experienced the bug it occurred 3-4 times.

So I disabled the collect errors and dev mode, as a test to see if perhaps it affected reproducibility, and within 20 minutes the bug occurred again (currently have a tab open with an affected site). I should note that hard reloading the tab doesn't resolve the bug, nor does opening a new tab of the site.

Edit: also seasonal cheers :)

Edit 2: re-enabled dev mode/etc and opened the console before refreshing the affected site. This is the output:

Uncaught (in promise) Error: Target disconnected
    at Proxy.exec (sw.js:1:7536)
    at Proxy.<anonymous> (sw.js:1:7405)
    at refreshSystemDark (sw.js:1:32664)
    at sw.js:1:92511
    at Array.map (<anonymous>)
    at sw.js:1:92483
sw.js:1 Uncaught TypeError: Cannot read properties of null (reading 'get')
    at MessagePort.onMessage (sw.js:1:8076)
sw.js:1 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'values')
    at trackTarget (sw.js:1:8253)

@tophf
Copy link
Member

tophf commented Dec 25, 2024

When the page wasn't styled, did you have Stylus' style manager page open? This bug is fixed in the upcoming v2.1.0. 🎄

I couldn't reproduce the new errors you've shown, so my fix may be incomplete. Can you verify it by installing this mv3 test build as an unpacked extension? You don't have to unpack it per se, just drag'n'drop the zip file into chrome://extensions page when developer mode switch is enabled. It'll be a separate extension, so disable the main one to avoid interference.

@chocmake
Copy link
Author

chocmake commented Dec 25, 2024

When the page wasn't styled, did you have Stylus' style manager page open?

No.

Can you verify it by installing this mv3 test build as an unpacked extension? ...

Sure. I'll report back if the error occurs again.

Do you expect having dev mode + collect errors would interfere at all with reproducibility? As it was a bit unexpected the issue not occurring only while that was enabled.

@tophf
Copy link
Member

tophf commented Dec 25, 2024

dev mode + collect errors would interfere

Unlikely, because it would be a bug in the browser that affects many extensions. It's more likely there's a heisenbug in Stylus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants