This repository has been archived by the owner on Dec 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Known issue: Options page not displayed by this version (but on-off-toolbar-button works). In theory this should also work in Thunderbird, but could not be tested unfortunately.
- Loading branch information
Showing
4 changed files
with
69 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Wrapper for old storage API in FireFox 45 – 48 | ||
if(browser.storage.local.get([], () => {}) === undefined) { | ||
let _storage_get = browser.storage.local.get; | ||
let _storage_set = browser.storage.local.set; | ||
|
||
browser.storage.local.get = function(keys) { | ||
// List of storage keys is mandatory in this browser version | ||
if(!keys) { | ||
keys = Object.keys(OPTIONS_DEFAULT); | ||
} | ||
|
||
// Interestingly enough the browser actually resolves the internally returned promise | ||
// and calls a (non-standard) callback parameter instead | ||
return new Promise((callback, errback) => { | ||
_storage_get(keys, callback); | ||
}); | ||
} | ||
|
||
browser.storage.local.set = function(options) { | ||
// Interestingly enough the browser actually resolves the internally returned promise | ||
// and calls a (non-standard) callback parameter instead | ||
return new Promise((callback, errback) => { | ||
_storage_set(options, callback); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters