stefanXO / Tab-Manager-Plus

An updated and improved Chrome and Firefox extension of the old google chrome extension "Tab Manager".
Other
382 stars 91 forks source link

Major bug: Windows names and colors are mixed up after browser restart #178

Open mastef opened 2 years ago

mastef commented 2 years ago

This is one of the biggest bugs of the extension. The reason for this is that window names and colors are saved based on the "window id" that we receive from the browser.

But once we restart the browser, the reopened windows may have mixed up "window id" parameters. So a window that had id 7855 before, may now have id 3422. Or some windows may have gotten the id of a previous window.

This seems like a frustrating issue.

Possibility of fixing it:

Every 10 or 60 seconds, make a snapshot of the open windows that have a custom name/custom color and snapshot what tabs they currently have saved. Also try this on a browser close event, if possible.

Once a browser is re-opened, and somehow fully loaded ( Can we time this? Is there an event when a browser restoration is complete? ), or if a window is restored from history ( e.g. "re-open 7 closed tabs" ) - then compare against the saved list if it matches any of the windows we had saved, and restore the color/name to it.

This is a very funky logic, which is why this bug has been so prevalent.

Also how long should we remember a window name/color? What if a second window is opened with the same tabs... which window are we monitoring then for changes?