A cross-browser extension to suspend inactive / unused tabs by "hiding" them behind a static, generic browser error page. Basically, to suspend https://moshe-gr.com, it will be redirected to http://localhost:0/#https://www.moshe-gr.com (try it) ).
Background:
=========
The great suspender was an extension that would automatically replace an open tab with a static, low memory page that would redirect back to the original on demand or after a set idle time. After a change of ownership, it was abused to contain malware, and therefore removed by Google.
Looking to avoid another extension by an unknown developer (who can always change), I opted to find a safer solution. I believe I have found it and want to share it in a way that can let others use / replicate it for their own benefit, at the level of knowledge and safety they require.
Why is this solution safer:
===================
- No static page - cannot be abused without changing the logic in a noticeable way.
- Hash parameter - not sent to a server by the browser, by design. I decided to use localhost:0 as a "host" to keep things local, and on a port that shouldn't conflict with other services / local servers. See why here: https://www.lifewire.com/port-0-...
- Simple code base - easy to fork, install manually, and if necessary - replicate. The core of the script boils down to:
.. const suspendPrefix = "https://localhost:0/#";
.. const toggleSuspendUrl = (pageUrl) =>
.... pageUrl.startsWith(suspendPrefix)
...... ? pageUrl.replace(suspendPrefix, "")
...... : `${suspendPrefix}${pageUrl}`;
.. if (browser) {
.... browser.browserAction.onClicked.addListener((tab) => {
...... browser.tabs.update(tab.id, { url: toggleSuspendUrl(tab.url) });
.... });
.. }
- The API I'm using doesn't require running Javascript code on the web page in the tab - just to get a page's URL. This makes the abuse potential minimal, and is reflected in the extensions limited permissions.
- Advanced features, if/when added, will be "opt in" via a separate installation (on stores if / when I upload them) / branch (or possibly repository) - to always provide a stable, simple, and secure base version.
@absurdfounder I made this after being "burnt" by "the Great Suspender" changing owners and being removed by Google from their store due to privacy concern (a lot more details here: https://github.com/greatsuspende...).
That extension replaced a suspended page with a static html page which, when pressed on, would restore a suspended tab. While convenient, this is exactly what allowed bad actors to take advantage of the extension to steal user data.
My approach is:
a. very basic - I generate a URL that is recognised as an error by all browsers, while retaining the original destination. This implementation will be hard to change without a noticeable change (in the url / page that results from the process).
b. much easier to restore manually - just remove the first part.
c. has instructions on how to build an independent version of the extension in the Github page so security concerns can be assuaged.
d . is based on very short and simple to understand code that makes it easily reproducible by anyone wanting their own secure solution or to learn.
e. creates "private" suspended pages (since they all appear as generic errors - a potential advantage for some).
f. cross-browser - so if you're someone running several browser (a.k.a a web developer :P, though not necessarily) it's nice to be able to use this tool if you're used to it (like I am, frankly) in a consistent manner.
Let me know if it's still unclear :).
Simple Suspender
Wonder Sites
Simple Suspender
Wonder Sites