Skip to content

Commit da51af8

Browse files
authoredJul 17, 2017
Simplify and improve
The browser version assumes that chrome.storage.local uses an API which is compatible with localStorage; which is not the case. Even though I am using chrome.storage.local for my Chrome extension, I would much prefer to keep debug's variable in localStorage, as I consider chrome.storage.local the 'private space' of my extension. This change obviates the need to support multiple storage types. But if storage type is important, how about supporting a custom storage facility, including chrome.storage.sync? I.e. the user would provide an object that follows the conventions. Just a thought - I certainly don't see the need at this point though.
1 parent a45d4a0 commit da51af8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed
 

‎src/browser.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ exports.formatArgs = formatArgs;
1010
exports.save = save;
1111
exports.load = load;
1212
exports.useColors = useColors;
13-
exports.storage = 'undefined' != typeof chrome
14-
&& 'undefined' != typeof chrome.storage
15-
? chrome.storage.local
16-
: localstorage();
13+
exports.storage = localstorage();
1714

1815
/**
1916
* Colors.

0 commit comments

Comments
 (0)
Please sign in to comment.