mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 01:02:08 +01:00
admin storage is accessed only by main context
This commit is contained in:
parent
892913d185
commit
43a5ed735b
4 changed files with 29 additions and 27 deletions
|
@ -1008,6 +1008,20 @@ vAPI.punycodeURL = function(url) {
|
|||
/******************************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/531
|
||||
// Storage area dedicated to admin settings. Read-only.
|
||||
|
||||
vAPI.adminStorage = {
|
||||
getItem: function(key, callback) {
|
||||
chrome.storage.managed.get(key, function(store) {
|
||||
callback(store[key] || undefined);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
vAPI.cloud = (function() {
|
||||
var chunkCountPerFetch = 16; // Must be a power of 2
|
||||
|
||||
|
|
|
@ -98,19 +98,6 @@ try {
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/531
|
||||
// Storage area dedicated to admin settings. Read-only.
|
||||
|
||||
vAPI.adminStorage = {
|
||||
getItem: function(key, callback) {
|
||||
chrome.storage.managed.get(key, function(store) {
|
||||
callback(store[key] || undefined);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
})();
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -3179,6 +3179,21 @@ vAPI.punycodeURL = function(url) {
|
|||
/******************************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/531
|
||||
// Storage area dedicated to admin settings. Read-only.
|
||||
|
||||
vAPI.adminStorage = {
|
||||
getItem: function(key, callback) {
|
||||
if ( typeof callback !== 'function' ) {
|
||||
return;
|
||||
}
|
||||
callback(vAPI.localStorage.getItem(key));
|
||||
}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
vAPI.cloud = (function() {
|
||||
var extensionBranchPath = 'extensions.' + location.host;
|
||||
var cloudBranchPath = extensionBranchPath + '.cloudStorage';
|
||||
|
|
|
@ -181,20 +181,6 @@ vAPI.localStorage.init('extensions.' + location.host + '.');
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
// https://github.com/gorhill/uBlock/issues/531
|
||||
// Storage area dedicated to admin settings. Read-only.
|
||||
|
||||
vAPI.adminStorage = {
|
||||
getItem: function(key, callback) {
|
||||
if ( typeof callback !== 'function' ) {
|
||||
return;
|
||||
}
|
||||
callback(vAPI.localStorage.getItem(key));
|
||||
}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
})();
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
Loading…
Reference in a new issue