fixes #90
This commit is contained in:
parent
486629ad0c
commit
c71646d295
2 changed files with 19 additions and 14 deletions
|
@ -89,6 +89,7 @@ chrome.storage.local.get(prefs, ps => {
|
|||
});
|
||||
|
||||
// update prefs.ua from the managed storage
|
||||
try {
|
||||
chrome.storage.managed.get({
|
||||
ua: ''
|
||||
}, rps => {
|
||||
|
@ -101,6 +102,10 @@ chrome.storage.local.get(prefs, ps => {
|
|||
ua.update(undefined, undefined, DCSI);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
ua.update(undefined, undefined, DCSI);
|
||||
}
|
||||
});
|
||||
|
||||
if (chrome.browserAction.setBadgeBackgroundColor) { // FF for Android
|
||||
|
@ -409,7 +414,6 @@ function match({url, tabId, cookieStoreId = DCSI}) {
|
|||
s = s || expand.rules[key];
|
||||
// use '*' when the hostname specific key is not found
|
||||
s = s || expand.rules['*'];
|
||||
console.log(s);
|
||||
// if s is an array select a random string
|
||||
if (Array.isArray(s)) {
|
||||
s = s[Math.floor(Math.random() * s.length)];
|
||||
|
|
|
@ -146,7 +146,8 @@ function update(ua) {
|
|||
else {
|
||||
throw Error('OS is not found');
|
||||
}
|
||||
}).finally(() => {
|
||||
// FF 55.0 does not support finally
|
||||
}).catch(() => {}).then(() => {
|
||||
parent.dataset.loading = false;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue