Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mneunomne committed Jan 21, 2025
1 parent 70a0ebe commit 09fdb70
Show file tree
Hide file tree
Showing 17 changed files with 185 additions and 185 deletions.
4 changes: 2 additions & 2 deletions platform/common/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/******************************************************************************/

import webext from './webext.js';
import { adnLog } from './console.js';
import { adnlog } from './console.js';
import { makeCloneable } from './adn/adn-utils.js';

/******************************************************************************/
Expand Down Expand Up @@ -1182,7 +1182,7 @@ vAPI.messaging = {
}

// Auxiliary process to main process: no handler
adnLog(
adnlog(
`vAPI.messaging.onPortMessage > unhandled request: ${JSON.stringify(request.msg)}`,
request
);
Expand Down
48 changes: 24 additions & 24 deletions src/js/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import µb from './background.js';
// adn
import adnauseam from './adn/core.js'
import dnt from './adn/dnt.js'
import { adnLog } from './console.js';
import { adnlog } from './console.js';

/******************************************************************************/

Expand Down Expand Up @@ -122,7 +122,7 @@ const resourceIsStale = (networkDetails, cacheDetails) => {
if ( typeof cacheDetails.resourceTime !== 'number' ) { return false; }
if ( cacheDetails.resourceTime === 0 ) { return false; }
if ( networkDetails.resourceTime < cacheDetails.resourceTime ) {
adnLog(`Skip ${networkDetails.url}\n\tolder than ${cacheDetails.remoteURL}`);
adnlog(`Skip ${networkDetails.url}\n\tolder than ${cacheDetails.remoteURL}`);
return true;
}
return false;
Expand Down Expand Up @@ -540,7 +540,7 @@ function getAssetSourceRegistry() {
if ( bin instanceof Object ) {
if ( bin.assetSourceRegistry instanceof Object ) {
assetSourceRegistry = bin.assetSourceRegistry;
adnLog('Loaded assetSourceRegistry');
adnlog('Loaded assetSourceRegistry');
return assetSourceRegistry;
}
}
Expand All @@ -552,7 +552,7 @@ function getAssetSourceRegistry() {
: assets.fetchText(µb.assetsJsonPath);
}).then(details => {
updateAssetSourceRegistry(details.content, true);
adnLog('Loaded assetSourceRegistry');
adnlog('Loaded assetSourceRegistry');
return assetSourceRegistry;
});
});
Expand Down Expand Up @@ -694,7 +694,7 @@ function getAssetCacheRegistry() {
if ( Object.keys(assetCacheRegistry).length !== 0 ) {
return console.error('getAssetCacheRegistry(): assetCacheRegistry reassigned!');
}
adnLog('Loaded assetCacheRegistry');
adnlog('Loaded assetCacheRegistry');
assetCacheRegistry = bin.assetCacheRegistry;
}).then(( ) =>
assetCacheRegistry
Expand Down Expand Up @@ -805,7 +805,7 @@ async function assetCacheRemove(pattern, options = {}) {
const keys = await cacheStorage.keys(re);
for ( const key of keys ) {
removedContent.push(key);
adnLog(`Removing stray ${key}`);
adnlog(`Removing stray ${key}`);
}
}
if ( removedContent.length !== 0 ) {
Expand Down Expand Up @@ -1253,7 +1253,7 @@ async function diffUpdater() {
}
}
if ( toHardUpdate.length === 0 ) { return; }
adnLog('Diff updater: cycle start');
adnlog('Diff updater: cycle start');
return new Promise(resolve => {
let pendingOps = 0;
const bc = new globalThis.BroadcastChannel('diffUpdater');
Expand All @@ -1262,7 +1262,7 @@ async function diffUpdater() {
bc.close();
resolve();
if ( typeof error !== 'string' ) { return; }
adnLog(`Diff updater: terminate because ${error}`);
adnlog(`Diff updater: terminate because ${error}`);
};
const checkAndCorrectDiffPath = data => {
if ( typeof data.text !== 'string' ) { return; }
Expand All @@ -1275,7 +1275,7 @@ async function diffUpdater() {
bc.onmessage = ev => {
const data = ev.data || {};
if ( data.what === 'ready' ) {
adnLog('Diff updater: hard updating', toHardUpdate.map(v => v.assetKey).join());
adnlog('Diff updater: hard updating', toHardUpdate.map(v => v.assetKey).join());
while ( toHardUpdate.length !== 0 ) {
const assetDetails = toHardUpdate.shift();
assetDetails.fetch = true;
Expand All @@ -1289,7 +1289,7 @@ async function diffUpdater() {
return;
}
if ( data.status === 'needtext' ) {
adnLog('Diff updater: need text for', data.assetKey);
adnlog('Diff updater: need text for', data.assetKey);
assetCacheRead(data.assetKey).then(result => {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1929326#c9
// Must never be set to undefined!
Expand All @@ -1301,7 +1301,7 @@ async function diffUpdater() {
return;
}
if ( data.status === 'updated' ) {
adnLog(`Diff updater: successfully patched ${data.assetKey} using ${data.patchURL} (${data.patchSize})`);
adnlog(`Diff updater: successfully patched ${data.assetKey} using ${data.patchURL} (${data.patchSize})`);
const metadata = extractMetadataFromList(data.text, [
'Last-Modified',
'Expires',
Expand All @@ -1316,44 +1316,44 @@ async function diffUpdater() {
assetCacheSetDetails(data.assetKey, metadata);
updaterUpdated.push(data.assetKey);
} else if ( data.error ) {
adnLog(`Diff updater: failed to update ${data.assetKey} using ${data.patchPath}\n\treason: ${data.error}`);
adnlog(`Diff updater: failed to update ${data.assetKey} using ${data.patchPath}\n\treason: ${data.error}`);
} else if ( data.status === 'nopatch-yet' || data.status === 'nodiff' ) {
adnLog(`Diff updater: skip update of ${data.assetKey} using ${data.patchPath}\n\treason: ${data.status}`);
adnlog(`Diff updater: skip update of ${data.assetKey} using ${data.patchPath}\n\treason: ${data.status}`);
assetCacheSetDetails(data.assetKey, { writeTime: data.writeTime });
broadcast({
what: 'assetUpdated',
key: data.assetKey,
cached: true,
});
} else {
adnLog(`Diff updater: ${data.assetKey} / ${data.patchPath} / ${data.status}`);
adnlog(`Diff updater: ${data.assetKey} / ${data.patchPath} / ${data.status}`);
}
pendingOps -= 1;
if ( pendingOps === 0 && toSoftUpdate.length !== 0 ) {
adnLog('Diff updater: soft updating', toSoftUpdate.map(v => v.assetKey).join());
adnlog('Diff updater: soft updating', toSoftUpdate.map(v => v.assetKey).join());
while ( toSoftUpdate.length !== 0 ) {
bc.postMessage(toSoftUpdate.shift());
pendingOps += 1;
}
}
if ( pendingOps !== 0 ) { return; }
adnLog('Diff updater: cycle complete');
adnlog('Diff updater: cycle complete');
terminate();
};
const worker = new Worker('js/diff-updater.js');
}).catch(reason => {
adnLog(`Diff updater: ${reason}`);
adnlog(`Diff updater: ${reason}`);
});
}

function updateFirst() {
adnLog('Updater: cycle start');
adnLog('Updater: prefer', updaterAuto ? 'CDNs' : 'origin');
adnlog('Updater: cycle start');
adnlog('Updater: prefer', updaterAuto ? 'CDNs' : 'origin');
updaterStatus = 'updating';
updaterFetched.clear();
updaterUpdated.length = 0;
diffUpdater().catch(reason => {
adnLog(reason);
adnlog(reason);
}).finally(( ) => {
updateNext();
});
Expand Down Expand Up @@ -1427,10 +1427,10 @@ async function updateNext() {
remoteServerFriendly = false;

if ( result.error ) {
adnLog(`Full updater: failed to update ${assetKey}`);
adnlog(`Full updater: failed to update ${assetKey}`);
fireNotification('asset-update-failed', { assetKey: result.assetKey });
} else {
adnLog(`Full updater: successfully updated ${assetKey}`);
adnlog(`Full updater: successfully updated ${assetKey}`);
updaterUpdated.push(result.assetKey);
if ( result.assetKey === 'assets.json' && result.content !== '' ) {
updateAssetSourceRegistry(result.content);
Expand All @@ -1449,9 +1449,9 @@ function updateDone() {
updaterStatus = undefined;
updaterAuto = false;
updaterAssetDelay = updaterAssetDelayDefault;
adnLog('Updater: cycle end');
adnlog('Updater: cycle end');
if ( assetKeys.length ) {
adnLog(`Updater: ${assetKeys.join()} were updated`);
adnlog(`Updater: ${assetKeys.join()} were updated`);
}
fireNotification('after-assets-updated', { assetKeys });
}
Expand Down
4 changes: 2 additions & 2 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { internalLinkDomainsDefault } from './adn/adn-utils.js'; // adn
import { FilteringContext } from './filtering-context.js';
import logger from './logger.js';
import { adnLogSet } from './console.js';
import { adnlogSet } from './console.js';

/******************************************************************************/

Expand Down Expand Up @@ -158,7 +158,7 @@ if (vAPI.webextFlavor.soup.has('devbuild')) {
userSettingsDefault.devMode = true;
hiddenSettingsDefault.consoleLogLevel = 'info';
hiddenSettingsDefault.cacheStorageAPI = 'unset';
adnLogSet(true);
adnlogSet(true);
}

/* Adn https://github.com/dhowe/AdNauseam/issues/2040 */
Expand Down
Loading

0 comments on commit 09fdb70

Please sign in to comment.