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