Releases: jbodner09/tab-lock
First Update
This update provides major upgrades to blocking functionality by inserting a script onto webpages that intercepts clicks and stops them before they even start a navigation. This has two benefits: One, it increases the number of situations in which potential navigations are blocked, and Two, it decreases the number of times a potential navigation disrupts the current page state.
Additionally, a few bugs with the initial release were fixed. First, lock state could sometimes be lost if the page is manually refreshed. Second, tab unlocking sometimes didn't work if an already-locked tab was then pinned (thus re-locking it). Finally, tab locking sometimes didn't work if the previous page the tab was on was the new tab page.
Finally, an options page was added in this release with the following options. One: An option to show a lock icon in the tab title (this functionality is new to this release and turned on by default). Two: An option to block navigations entirely instead of opening them in a new tab (turned off by default). Three: An option to open new tabs in the foreground (turned off by default, which is different behavior than in the previous release). Four: An option to automatically lock pinned tabs (this is turned off by default, which is different behavior than in the previous release).
Initial release
This is the fully-functional prototype of Tab Lock. It does exactly two things: it lets you lock tabs, and it prevents locked tabs from navigating.
More specifically, tab locking is accomplished by clicking the Browser Action button. It's a toggle, and it applies to the currently active tab. Additionally, pinning a tab automatically locks it (it can be manually unlocked), and unpinning it unlocks it. You can tell if a tab is locked or not by the state of the Browser Action icon. Additionally, upon startup, if any pinned tabs are restored, they'll be locked automatically.
When a tab is locked, navigations that would overwrite the entire tab in a way that would add an entry to the back/forward stack are blocked, and instead opened in a new tab. Right now, the new tab is activated upon opening, but an option coming in the future will let it be opened in the background. Also, the preserved tab has to refresh its state, which may affect certain things like where it's scrolled to. Some navigations that only modify part of the page, like infinitely scrolling lists, aren't blocked.
There are quite a few other options that will be added in the future. First, better restoration. Right now, once a tab is closed, its lock state is completely gone. This is true even if it's later restored via session restore, etc. The only exception to this is pinned tabs that are restored upon startup, as mentioned above. In the future, you'll be able to restore the lock state of all locked tabs that are restored upon startup, as well as recently closed tabs. There will also be an option not to automatically lock and unlock pinned tabs, both on startup and on demand.
Speaking of closing tabs, a future option will add the ability to block a tab from being closed if it's locked, or at least prompt that you might not want to close it. Another option will give a visual indicator when a blocked link is opened in a background tab or blocked. Also, there will be an option to completely block opening new tabs, enhanced badging on the favicon of a locked tab, and context menu and keyboard shortcut entries to lock/unlock the current tab.