rNeomy / auto-tab-discard

Use native tab discarding method to automatically reduce memory usage of inactive tabs
https://webextension.org/listing/tab-discard.html
Mozilla Public License 2.0
906 stars 79 forks source link

Change favicon of tabs that are "kept" #258

Open nkakouros opened 2 years ago

nkakouros commented 2 years ago

When you select a tab to be kept and not be discarded (by right clicking on the tab), it would be useful to show an icon on the website that showed the tab will not be discarded.

rNeomy commented 2 years ago

Unfortunately, there is no API to visually change the tab's appearance. Since the tab is active, we cannot even alter its title since the website might want to use the title itself. I'll keep this open for suggestions.

nkakouros commented 2 years ago

I see. How is the zzz icon added to discarded tabs?

rNeomy commented 2 years ago

We inject a JS code just before it gets discarded to prepend a custom string to the tab's title. This is okay since, in the discarded state, there is no page code running. Hence updating the title is not interfering with the tab's code.