stylus
stylus copied to clipboard
Open style sheet editor in new window don't remember the last place it was opened and the size i chose for it
Bug Report
Bug Description
As the title say, the editor open always in the same place, but: It don't remember its last place where i put it (in my 2nd screen) it don't remember too its last size.
Before the update, no problem about that.
System Information
tested With Chrome and Waterfox Classic
- OS: Win10
- Browser: Chrome / Waterfox Classic
- Stylus Version: 1.5.25
Additional Context
OPTIONS: "Open in a new window" and "Open simple window" checked or checked only "Open in a new window" give the result. Open style sheet editor in new window without tab bars
It certainly works for me but I only have one display. Please open devtools console of the editor window and run the following code: [screenX, screenY]
, then paste the result here.
Test in Chrome:
- 1 - Open in the first display and resize it [screenX, screenY] (2) [0, 450]
- 2 - Reopen it (it self open on the First display and keep its vertical size but not its horizontal size) and without moving on the 2nd display: [screenX, screenY] (2) [0, 367]
- 3 - Reopen and moving on the 2nd display: [screenX, screenY] (2) [2139, 367]
Dev Console provide an Error message:
Test with Waterfox Classic: 1 - Result when first open it in the principal display: [screenX, screenY] Array [ 0, 99 ] 2 - After moving to the 2nd display and changing its size: [screenX, screenY] Array [ 2069, 282 ] 3 - Result after closed and reopening the edoter: It keep its last size but Stay at its last place... on the wrong display (the Principal not the 2nd as expected): Dev console: [screenX, screenY] Array [ 0, 282 ]
Same result with Firefox Quantum: 1 - First open: [screenX, screenY] Array [ 0, 282 ] 2 - Reopen after place it on the 2nd display: Keep its size but open on the wrong display: [screenX, screenY] Array [ 31, 391 ]
Hmm.
- Please also run
prefs.values.windowPosition
in devtools console after moving the editor. - Maybe the browsers started to limit the position of the window... Try installing an older version of Stylus (after backing up the styles) in your current browser and see if it saves the position.
Test prefs.values.windowPosition in Quantum:
First open:
{
"left": 31,
"top": 391,
"width": 1042,
"height": 582
}
After moving (couplet result):
Object { left: 31, top: 391, width: 1042, height: 582 }
height: 582
left: 31
top: 391
width: 1042
Quick test with an other Quantum's profile with Stylus not updated: All work perfectly
So which version of Stylus works?
It seems the v.1.5.11 ....
It's an old version so it's hard to pinpoint the problem at once especially since I can't debug it myself.
Run editor.isWindowed
in devtools console and see if it prints true
.
Run the following code in devtools console after moving the window, then re-open it:
prefs.set('windowPosition', {
left: screenX,
top: screenY,
width: outerWidth,
height: outerHeight,
});
In this old Quantum's profile, i installing the previous version 1.5.24 (before the last update): All work fine. You want i test "editor.isWindowed" in this one now?
In Chrome 1- First test (editor.isWindowed): true 2 - 2nd test ( after moving the window, then re-open it): undefined See an error in it before i test you code: Uncaught TypeError: Cannot read properties of null (reading 'offsetWidth') at header-resizer.js:6:26 at header-resizer.js:48:3
1.5.24 is the same as 1.5.25 in regards to the editor window position, so if 24 works but 25 doesn't, can only mean there's a bug in the browser, but judging by editor.isWindowed
difference the bug is in Stylus and it should be present in both versions.
Strange...
editor.isWindowed difference occurs only when re-opening the editor via Ctrl-Shift-T and it's a bug in Chrome. It doesn't happen when the editor is opened normally. Try fully reinstalling the extension in your main profile.
I dot it with Quantum: Same problem...
So 1.5.24 works in this main profile or in another profile?
I an other old Quantum's profile. In this one i do: 1 - Test Stylus before any update (was the v.1.5.11) Work fine 2 - Always in this profile, i installing the previous version 1.5.24 Work fine 3 - Remove Stylus and install its last version(v.1.5.25): Problem
Since there's no difference in the code between 24 and 25 I guess the only explanation is a bug in the profile itself :-)
But the problem persist after the last update (with any type of profile) with Chrome / Firefox Quantum and Waterfox Classic.....
But maybe it's me, if i am the only one with 2 display which have this problem..... ;-)
I don't understand or maybe i explain not very well...
At the opposite of you said, there is a big difference:
With Chrome / Firefox Quantum and Waterfox Classic (and any sort of profiles) 1 - version 1.5.24 and previous v.1.5.11 Work fine 2 - version 1.5.25 Problem
Hmmm, but yes, it's not "reproducible" if you have only one display. :-)
I return on this problem: Nobody, with 2 display, can test if it's only a problem of my side ?
v.1.5.11 works fine. Downgraded without even backing up. Suffered this bug for idk how long til now.
Stylus window kept opening in the same page as page I wanted to mod the style, and also all of its inner section were minimized to about 80px of height, in a window about 200px high.
v.1.5.11 opens in the last used location and display, with a fix height (W 1698px by H 962px) just as it's supposed to :)
I really don't think I'll upgrade any soon. (I'm running 4 display/monitors)
This old version didn't check the correctness of a saved window position, so evidently our current verification is incorrect. I guess in a multi-display setup there's a common virtual coordinate space, so the saved position may be outside the bounds of the active display. I guess the solution would be to pass the coordinates as-is and if the call fails, change them then, not beforehand.
edit: By curiosity, I have just updated Stylus to see if the bug came back. It did not. Seems to me that downgrade and then upgrade was enough to put things back in order (all without backing up)
downgrade and then upgrade was enough
It probably cleared windowPosition
in prefs.
downgrade and then upgrade was enough
Tested with Waterfox: No change for me (not remember in which display it should be open). How to downgrade with chrome (i don't see version in Chrome store)? Note: If you want test the downgrade don't forget to backup your userstyles before...
With Chrome you can simply install the latest development version that fixed the bug properly. As an unpacked extension.
Thanks for the info. But as it seems a little bit complicated vs the urge: i can certainly wait your next update :-)
It's really trivial, just enable the checkbox and drag'n'drop the extracted directory into chrome://extensions page. Takes a few seconds.