You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user reloads (or updates) the extension when persistent borders are active, then a stray border can be left on the page (until its landmark is highlighted again).
Whilst this probably won't adversely affect many users, it is best practice to clean up when necessary. The onSuspend event fires when an Event (not standard Background) page is going to be suspended, but it doesn't look like there's an event for when the whole extension is to be uninstalled—though a StackOverflow answer seems to imply it would be called on uninstall.
Either way, Firefox and Edge don't implement this yet, and Landmarks uses a Background page, not an Event page, plus it seems best to wait and see if a more apt event is added in future. The worst that can happen currently is that a duplicate border is sometimes drawn, but will be removed as the user navigates through the landmark again.
The text was updated successfully, but these errors were encountered:
If the events-based solution works on Firefox, then it could be used as a general solution for both this issue and #131. If not, then it's probably best to solve them separately (for now, until some sort of standard event for "extension is about to be disabled/uninstalled" is provided).
Think it's best to leave this for now; the behaviour between Firefox and Chrome is too different to solve generally, because what's needed is a generic callback/event to handle cleanup on extensions being disabled, but this doesn't exist in WebExtensions, and the port.onDisconnect() workaround won't work in Firefox (Firefox seems to have a cleaner approach to content scripts generally).
Haven't tried the events-based solution, but it isn't relevant here anyway, because we can't assume that a reload is taking place—we need to know when it's being unloaded regardless of whether it is being disabled, uninstalled or ultimately reloaded.
If the user reloads (or updates) the extension when persistent borders are active, then a stray border can be left on the page (until its landmark is highlighted again).
Whilst this probably won't adversely affect many users, it is best practice to clean up when necessary. The
onSuspend
event fires when an Event (not standard Background) page is going to be suspended, but it doesn't look like there's an event for when the whole extension is to be uninstalled—though a StackOverflow answer seems to imply it would be called on uninstall.Either way, Firefox and Edge don't implement this yet, and Landmarks uses a Background page, not an Event page, plus it seems best to wait and see if a more apt event is added in future. The worst that can happen currently is that a duplicate border is sometimes drawn, but will be removed as the user navigates through the landmark again.
The text was updated successfully, but these errors were encountered: