-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add proper window state handling #6
base: main
Are you sure you want to change the base?
Conversation
not sure if "focusChanged" is fired on browser start btw.
…ate is "off" for each browser restart. New window inherits toggles from last active window
In what order are |
I don't know about your last question but that shouldn't be too hard to find out. Is it important for the pull-request, e.g. is it compete in the current state? I'm not using multiple windows myself so I haven't actually thought about this functionality to be honest. I'm willing to merge and publish your code if it works because it looks fine to me (could use some more spaces though 😉) but I don't know when I'll get a chance to test it myself. |
Okay I will then try packing it and testing myself.
If I use getLastFocused() then it won't be a preoblem anymore. |
Packaging is quite easy. Compress the whole thing into a zipfile: https://extensionworkshop.com/documentation/publish/package-your-extension/ |
There are multiple problems. 🙃 |
Seems to be working well now. |
The only important thing left is that there is no sense in storing runtime state in local storage, I should just use global variable for that. |
fixed it now |
Right now window handling is incomplete: the state of toggles is global but the shortcuts and toolbar acts on the window state and does not change other windows. This manifests itself in the bug: if you try to toggle a switch in two windows, it will take 2 button presses to activate the style in second window.
I do not know about others but it seems to me that per-window handling is desired way of operation. Therefore this pull request makes the behaviour consistent with my idea.
Please test it yourself, I did not (I have no desire to setup anything to debug it).