mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Moved localconfig to SB object
This commit is contained in:
6
utils.js
6
utils.js
@@ -13,7 +13,7 @@ function configProxy() {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
get: function(obj, prop) {
|
get: function(obj, prop) {
|
||||||
return localconfig[prop]
|
return SB.localconfig[prop]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return new Proxy({}, handler);
|
return new Proxy({}, handler);
|
||||||
@@ -21,13 +21,13 @@ function configProxy() {
|
|||||||
|
|
||||||
fetchConfig = _ => new Promise(function(resolve, reject) {
|
fetchConfig = _ => new Promise(function(resolve, reject) {
|
||||||
chrome.storage.sync.get(null, function(items) {
|
chrome.storage.sync.get(null, function(items) {
|
||||||
localconfig = items; // Data is ready
|
SB.localconfig = items; // Data is ready
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
async function config() {
|
async function config() {
|
||||||
localconfig = {};
|
SB.localconfig = {};
|
||||||
await fetchConfig();
|
await fetchConfig();
|
||||||
SB.config = configProxy();
|
SB.config = configProxy();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user