stoically / radical

Element (Riot Web) unofficially bundled as Firefox Add-on
https://addons.mozilla.org/firefox/addon/radical-web
MIT License
32 stars 1 forks source link

Delay Add-on update to prevent closing tab #4

Closed stoically closed 4 years ago

stoically commented 4 years ago

Currently if the Add-on updates it'll close the open riot web tabs, since those are part of the Add-on and hence need to be reopened.

It's possible to delay updates by listening to the runtime.onUpdateAvailable event - either until the browser restarts or until calling runtime.reload explicitly.

stoically commented 4 years ago

Implemented and released as v1.5.7.6.

stoically commented 4 years ago

I've introduced the "storage" and "tabs" permissions to make that work; but realized that it might be possible to do it without. It could be as simple as letting every riot tab send a message to the background on load and track that accordingly, together with tabs.onRemoved listener for cleanup purposes. Will have to check again.

stoically commented 4 years ago

After thinking about it a bit more: This would require informing the background on every state (hash) change in riot web, so it could get really flaky and noisy. So having the "tabs" permission to make it background-driven and reliable is imho a small price to pay.

stoically commented 4 years ago

So, Chrome shows the "tabs" permission as "It can: Read your browsing history". Given that, I'll reopen this yet again. Instead of the riot tab sending a message to the background it could just write to storage directly. That's a small price to pay for Chrome not showing such a scary permission prompt.

stoically commented 4 years ago

So, finally found a way to cleanly update without "tabs" permission: this uses extension.getViews now.

stoically commented 4 years ago

Turns out that reopening of Riot tabs in containers doesn't work. Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1611697