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
feat: automatic re-isolation after n seconds (#315) #429
Conversation
Add handler logic in isolation.ts Add a new function setIsolation, to consolidate some overlapping code Replace code in commands.ts with setIsolation function Update addIsolationInactiveBadge in browseraction.ts to accept an optional counter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for working on this! Only got minor variable wording nits.
Something that came to mind which might make this slightly more complicated - how should automatically re-enabling isolation behave in case of Firefox shutdown/restart? Like, if I set the delay to 60seconds and just happen to close Firefox while it ticks down, it'll stay disabled after Firefox starts again. Maybe it might make sense to store the re-enable target time in storage (not preferences) and check that while initialization as well?
Adds isolation helpers setActiveState and handleActiveState to consolidate isolation toggle code Consolidates pageaction.showOrHide into isolation.handleActiveState Renames members in isolation.ts with a common root autoEnable* Adds isolation local storage so the auto re-isolation can resume if Firefox closed Adds tests for isolation active, auto re-isolation, and the toggle_isolation keyboardShortcut
New commit should resolve all conversations above, and addresses the question of an interrupted countdown if the browser is closed. Using the local storage was rather seamless, thanks to your storage class! I think there's a good argument to move the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding tests and the initialization logic, that's really thorough work!
Renames autoEnable naming prefix to automaticReactivate to better associate with main "active" var Removes unneeded comments and debug code
Removes placeholder comments
New commit. |
Updates isolation tests to avoid internal method calls Clarifies background test descriptions
What kind of error did you encounter? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
You can disregard. Now that I'm caught up on the main branch, the head is compiling clean. |
Thanks for the merge! I will work on refactoring the isolation active flag in a new PR related to #433 |
Add handler logic in isolation.ts
Add a new function setIsolation, to consolidate some overlapping code
Replace code in commands.ts with setIsolation function
Update addIsolationInactiveBadge in browseraction.ts to accept an optional counter
Closes #315