davidtodd/landmarks — pull request #3 by matatk (2013-05-24 14:19:00+00:00)
Title: Preferences without restart; simpler build process and uncovered a bug with tabbed browsing

I've done some cleanup of the build system, UI and have also made the extension reflect changes in preferences as they are changed (i.e. without a browser restart).

However this has shown up a bug that seems quite fundamental to how this (and maybe other) extensions work: when the browser tab changes, we loose the state of the current page (i.e. `previousSelectedIndex`). If we then go back to that page later, it is possible to have a border "stuck" on an element until we cycle back through it.

I noticed this when implementing preferences being reflected instantly because opening the Add-Ons tab triggers this behaviour. If one has the Add-Ons tab open always, the border preferences are properly changed in real-time. If one opens the Add-Ons tab to change the preferences, the state of the web page tab is overwritten, so the code doesn't know which element to remove/add a border from/to when the preference changes.

I am not sure what is the best way to combat this -- keep state for each open tab, or maybe there is a mode for Firefox extensions that runs code specific to each tab (I would hope for the latter).

Perhaps the best way to proceed, if you have time and are able to work on this, would be for me to file that bug on your repo (as that's the root) to go into this further? If you are not able to work on it I'll just file the bug on mine and try to hack away at it, and make a pull request if/when I fix it.

Please let me know which works for you.