mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
this fixes #900
This commit is contained in:
parent
ce7739c3da
commit
0c5a9bfba6
@ -1024,6 +1024,8 @@ vAPI.punycodeURL = function(url) {
|
|||||||
// extension on Opera ends up in a non-sensical state, whereas vAPI become
|
// extension on Opera ends up in a non-sensical state, whereas vAPI become
|
||||||
// undefined out of nowhere. So only solution left is to test explicitly for
|
// undefined out of nowhere. So only solution left is to test explicitly for
|
||||||
// Opera.
|
// Opera.
|
||||||
|
// https://github.com/gorhill/uBlock/issues/900
|
||||||
|
// Also, UC Browser: http://www.upsieutoc.com/image/WXuH
|
||||||
|
|
||||||
vAPI.adminStorage = {
|
vAPI.adminStorage = {
|
||||||
getItem: (function() {
|
getItem: (function() {
|
||||||
@ -1033,10 +1035,19 @@ vAPI.adminStorage = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
return function(key, callback) {
|
return function(key, callback) {
|
||||||
|
var onRead = function(store) {
|
||||||
|
var data;
|
||||||
|
if (
|
||||||
|
!chrome.runtime.lastError &&
|
||||||
|
typeof store === 'object' &&
|
||||||
|
store !== null
|
||||||
|
) {
|
||||||
|
data = store[key];
|
||||||
|
}
|
||||||
|
callback(data);
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
chrome.storage.managed.get(key, function(store) {
|
chrome.storage.managed.get(key, onRead);
|
||||||
callback(store[key] || undefined);
|
|
||||||
});
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user