mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-26 04:12:50 +01:00
Various minor code review
This commit is contained in:
parent
a02c241842
commit
1ffdb7d948
@ -143,7 +143,7 @@ vAPI.alarms = {
|
||||
const delayInMinutes = this.normalizeDelay(delay);
|
||||
browser.alarms.get(this.name, alarm => {
|
||||
if ( alarm ) { return; }
|
||||
return browser.alarms.create(this.name, { delayInMinutes });
|
||||
browser.alarms.create(this.name, { delayInMinutes });
|
||||
});
|
||||
}
|
||||
offon(delay) {
|
||||
|
@ -91,7 +91,7 @@ const ttlManage = function(count) {
|
||||
ttlTimer.off();
|
||||
ttlCount += count;
|
||||
if ( ttlCount > 0 ) { return; }
|
||||
if ( lz4CodecInstance === null ) { return; }
|
||||
if ( lz4CodecInstance === undefined ) { return; }
|
||||
ttlTimer.on(ttlDelay);
|
||||
};
|
||||
|
||||
|
@ -1211,6 +1211,7 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
||||
|
||||
const create = async function() {
|
||||
if ( µb.inMemoryFilters.length !== 0 ) { return; }
|
||||
if ( Object.keys(µb.availableFilterLists).length === 0 ) { return; }
|
||||
await Promise.all([
|
||||
io.put(
|
||||
'selfie/main',
|
||||
@ -1245,12 +1246,10 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
||||
selfie = JSON.parse(details.content);
|
||||
} catch(ex) {
|
||||
}
|
||||
if (
|
||||
selfie instanceof Object === false ||
|
||||
selfie.magic !== µb.systemSettings.selfieMagic
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if ( selfie instanceof Object === false ) { return false; }
|
||||
if ( selfie.magic !== µb.systemSettings.selfieMagic ) { return false; }
|
||||
if ( selfie.availableFilterLists instanceof Object === false ) { return false; }
|
||||
if ( Object.keys(selfie.availableFilterLists).length === 0 ) { return false; }
|
||||
µb.availableFilterLists = selfie.availableFilterLists;
|
||||
return true;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user