1
0
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:
Raymond Hill 2023-04-25 21:15:11 -04:00
parent a02c241842
commit 1ffdb7d948
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 7 additions and 8 deletions

View File

@ -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) {

View File

@ -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);
};

View File

@ -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;
};