Closed VesterDe closed 6 years ago
First load the kittyPluginVersion is not set. Set it to 0 if it doesn't exist. Also change plugin to extension, trying to keep things consistent.
var savedVersion = localStorage.getItem('kittyPluginVersion') || 0;
The || 0 part of the localStorage getter isn't really needed is it? localStorage returns null if the key doesn't exist. Null will act the same as 0 in this case.
I've added it anyway, it's your repository. And I merged your latest changes.
Tested it some more and it kicks you out of the whole site. Don't think that would be a nice experience for people. Instead of clearing the entire storage you can just set the storage values to empty.
Good call, it didn't happen to me but it's a better idea to only delete those 2 keys yes, I didn't notice the page also saves some data to localStorage already.
So far the thing has been backwards incompatible most of the time so this should improve UX for future changes.