ChessCom / browser-extension

Customize your Chess.com experience
Other
48 stars 16 forks source link

Switch to chrome.storage.sync once FireFox supports this #52

Open martynchamberlin opened 7 years ago

martynchamberlin commented 7 years ago

Essentially we want to undo the changes made in this commit. https://github.com/ChessCom/browser-extension/pull/48/commits/c232aa9303f06bae9eb4d0b1fa99bf61d8d4eaf1

emilgoldsmith commented 7 years ago

What about setting an environment variable that indicates whether it was built for Chrome or Firefox (which already have separate webpack config files so that's easy), and then in all these places you just changed it, just make an if else statement?

Just because I'm sure it's nice if at least Chrome users could benefit from the whole Chrome user experience of independence of device.

martynchamberlin commented 7 years ago

Actually looks like we can already do it for Firefox now: https://wiki.mozilla.org/WebExtensions/chrome.storage.sync

Not sure if, when the user disables this feature in FF, you could still use it. We'd have to test that. If not then here's a way to check if it's been activated: http://stackoverflow.com/questions/15274481/how-to-detect-if-chrome-sync-feature-is-active-chrome-extension

emilgoldsmith commented 7 years ago

Yeah I can get on that at some point.

P.S: Sorry for closing, clicked the close and comment button by accident ;)