Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit 96f62c1

Browse files
committed
Prepare for Opera and Edge
1 parent 91cb184 commit 96f62c1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

js/preferences.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* This class holds all the logic related to user preferences persistance.
2323
*/
2424
constructor() {
25-
if (globals.browser) { // Firefox uses `browser`, Chrome uses `chrome`
26-
this.getAll = this.getAllFirefox;
27-
this.setAll = this.setAllFirefox;
25+
if (globals.browser) { // Firefox and Edge uses `browser`, Chrome and Opera uses `chrome`
26+
this.getAll = this.getAllBrowser;
27+
this.setAll = this.setAllBrowser;
2828
} else if (globals.chrome) {
2929
this.getAll = this.getAllChrome;
3030
this.setAll = this.setAllChrome;
@@ -36,9 +36,9 @@
3636
/**
3737
* Get all the user's preferences.
3838
*
39-
* Used as `getAll` if the current browser is Firefox.
39+
* Used as `getAll` if the current browser is Firefox or Edge.
4040
*/
41-
getAllFirefox(successCallback) {
41+
getAllBrowser(successCallback) {
4242
browser.storage.local.get(this.defaults).then(successCallback, function() {
4343
alert('Error retrieving extension preferences.');
4444
});
@@ -47,9 +47,9 @@
4747
/**
4848
* Save all the user's preferences.
4949
*
50-
* Used as `setAll` if the current browser is Firefox.
50+
* Used as `setAll` if the current browser is Firefox or Edge.
5151
*/
52-
setAllFirefox(preferences, successCallback, errorCallback) {
52+
setAllBrowser(preferences, successCallback, errorCallback) {
5353
browser.storage.local.set(preferences).then(successCallback, function() {
5454
errorCallback();
5555

@@ -60,7 +60,7 @@
6060
/**
6161
* Get all the user's preferences.
6262
*
63-
* Used as `getAll` if the current browser is Chrome.
63+
* Used as `getAll` if the current browser is Chrome or Opera.
6464
*/
6565
getAllChrome(successCallback) {
6666
chrome.storage.local.get(this.defaults, function(preferences) {
@@ -77,7 +77,7 @@
7777
/**
7878
* Save all the user's preferences.
7979
*
80-
* Used as `setAll` if the current browser is Chrome.
80+
* Used as `setAll` if the current browser is Chrome or Opera.
8181
*/
8282
setAllChrome(preferences, successCallback, errorCallback) {
8383
chrome.storage.local.set(preferences, function() {

0 commit comments

Comments
 (0)