sloth
sloth copied to clipboard
Suspend tabs when opening multiple bookmarks
Use case: In addition to starting chrome with several tabs from the last session I often open a whole folder of bookmarks at once which has the same hit on performance as starting with lots of tabs. Request: Is it possible to suspend tabs in this case, ideally controlled by an option that by default gives the current behaviour, except when activated (then opening multiple tabs would also suspend them).
Here's what I understood from your request: A button to enable or disable lazy mode. When in lazy mode, any new tab opened will be automatically "discarded" (suspended), and the previously open tab will retain the focus.
We can try to implement this together, if you are willing to spend the time.
We first need to find a hook that gets called when a new tab is opened. If you see eventPage.js
, it is adding listeners to only two hooks: browser startup
and icon clicked
. We will have to add another listener for new tab opened
hook, if we find it.
Thanks for responding - and, yes, your understanding is correct - where it ocurred to me that one might need to distinguish between opening just one tab (standard case) - or a whole bunch (my focus). I am happy to help, but am afraid that this is limited to trying out some experimental version - lacking understanding of chrome's interaction- and programming-model - already in the aspects you mentioned last:(
any news on this?
any news on this?
No, afraid not. We need someone who is familiar with Chrome's API. And now that they are going to introduce Manifest V3 or some such thing, this extension might even become obsolete.
... And now that they are going to introduce Manifest V3 or some such thing, this extension might even become obsolete.
Why? I've copied your exact code from 4 or so years ago into my personal extension. I haven't changed it ever since, and after updating to MV3, it still suspends tabs the way it used to.
Yeah, it works for me too, without changes. I am surprised that they have maintained backward compatibility.
Feel free to point to any extension that you have published. Maybe others who need this functionality will find it useful. PR is welcome too.