mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Work around localStorage not available in private windows. Fix #1163.
This commit is contained in:
parent
52fdd252d2
commit
8572ff6b42
@ -311,8 +311,12 @@ refreshActivePageIfEnabled = ->
|
||||
chrome.runtime.onMessage.addListener (request, sender, respond) ->
|
||||
return unless request and request.method
|
||||
options.ready.then ->
|
||||
target = options
|
||||
method = target[request.method]
|
||||
if request.method == 'getState'
|
||||
target = state
|
||||
method = state.get
|
||||
else
|
||||
target = options
|
||||
method = target[request.method]
|
||||
if typeof method != 'function'
|
||||
Log.error("No such method #{request.method}!")
|
||||
respond(
|
||||
|
@ -24,6 +24,10 @@ var requestInfoCallback = null;
|
||||
|
||||
OmegaTargetPopup = {
|
||||
getState: function (keys, cb) {
|
||||
if (typeof localStorage === 'undefined' || !localStorage.length) {
|
||||
callBackground('getState', [keys], cb);
|
||||
return;
|
||||
}
|
||||
var results = {};
|
||||
keys.forEach(function(key) {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user