@@ -30,7 +30,7 @@ import µb from './background.js';
3030// adn
3131import adnauseam from './adn/core.js'
3232import dnt from './adn/dnt.js'
33- import { adnLog } from './console.js' ;
33+ import { adnlog } from './console.js' ;
3434
3535/******************************************************************************/
3636
@@ -122,7 +122,7 @@ const resourceIsStale = (networkDetails, cacheDetails) => {
122122 if ( typeof cacheDetails . resourceTime !== 'number' ) { return false ; }
123123 if ( cacheDetails . resourceTime === 0 ) { return false ; }
124124 if ( networkDetails . resourceTime < cacheDetails . resourceTime ) {
125- adnLog ( `Skip ${ networkDetails . url } \n\tolder than ${ cacheDetails . remoteURL } ` ) ;
125+ adnlog ( `Skip ${ networkDetails . url } \n\tolder than ${ cacheDetails . remoteURL } ` ) ;
126126 return true ;
127127 }
128128 return false ;
@@ -540,7 +540,7 @@ function getAssetSourceRegistry() {
540540 if ( bin instanceof Object ) {
541541 if ( bin . assetSourceRegistry instanceof Object ) {
542542 assetSourceRegistry = bin . assetSourceRegistry ;
543- adnLog ( 'Loaded assetSourceRegistry' ) ;
543+ adnlog ( 'Loaded assetSourceRegistry' ) ;
544544 return assetSourceRegistry ;
545545 }
546546 }
@@ -552,7 +552,7 @@ function getAssetSourceRegistry() {
552552 : assets . fetchText ( µb . assetsJsonPath ) ;
553553 } ) . then ( details => {
554554 updateAssetSourceRegistry ( details . content , true ) ;
555- adnLog ( 'Loaded assetSourceRegistry' ) ;
555+ adnlog ( 'Loaded assetSourceRegistry' ) ;
556556 return assetSourceRegistry ;
557557 } ) ;
558558 } ) ;
@@ -694,7 +694,7 @@ function getAssetCacheRegistry() {
694694 if ( Object . keys ( assetCacheRegistry ) . length !== 0 ) {
695695 return console . error ( 'getAssetCacheRegistry(): assetCacheRegistry reassigned!' ) ;
696696 }
697- adnLog ( 'Loaded assetCacheRegistry' ) ;
697+ adnlog ( 'Loaded assetCacheRegistry' ) ;
698698 assetCacheRegistry = bin . assetCacheRegistry ;
699699 } ) . then ( ( ) =>
700700 assetCacheRegistry
@@ -805,7 +805,7 @@ async function assetCacheRemove(pattern, options = {}) {
805805 const keys = await cacheStorage . keys ( re ) ;
806806 for ( const key of keys ) {
807807 removedContent . push ( key ) ;
808- adnLog ( `Removing stray ${ key } ` ) ;
808+ adnlog ( `Removing stray ${ key } ` ) ;
809809 }
810810 }
811811 if ( removedContent . length !== 0 ) {
@@ -1253,7 +1253,7 @@ async function diffUpdater() {
12531253 }
12541254 }
12551255 if ( toHardUpdate . length === 0 ) { return ; }
1256- adnLog ( 'Diff updater: cycle start' ) ;
1256+ adnlog ( 'Diff updater: cycle start' ) ;
12571257 return new Promise ( resolve => {
12581258 let pendingOps = 0 ;
12591259 const bc = new globalThis . BroadcastChannel ( 'diffUpdater' ) ;
@@ -1262,7 +1262,7 @@ async function diffUpdater() {
12621262 bc . close ( ) ;
12631263 resolve ( ) ;
12641264 if ( typeof error !== 'string' ) { return ; }
1265- adnLog ( `Diff updater: terminate because ${ error } ` ) ;
1265+ adnlog ( `Diff updater: terminate because ${ error } ` ) ;
12661266 } ;
12671267 const checkAndCorrectDiffPath = data => {
12681268 if ( typeof data . text !== 'string' ) { return ; }
@@ -1275,7 +1275,7 @@ async function diffUpdater() {
12751275 bc . onmessage = ev => {
12761276 const data = ev . data || { } ;
12771277 if ( data . what === 'ready' ) {
1278- adnLog ( 'Diff updater: hard updating' , toHardUpdate . map ( v => v . assetKey ) . join ( ) ) ;
1278+ adnlog ( 'Diff updater: hard updating' , toHardUpdate . map ( v => v . assetKey ) . join ( ) ) ;
12791279 while ( toHardUpdate . length !== 0 ) {
12801280 const assetDetails = toHardUpdate . shift ( ) ;
12811281 assetDetails . fetch = true ;
@@ -1289,7 +1289,7 @@ async function diffUpdater() {
12891289 return ;
12901290 }
12911291 if ( data . status === 'needtext' ) {
1292- adnLog ( 'Diff updater: need text for' , data . assetKey ) ;
1292+ adnlog ( 'Diff updater: need text for' , data . assetKey ) ;
12931293 assetCacheRead ( data . assetKey ) . then ( result => {
12941294 // https://bugzilla.mozilla.org/show_bug.cgi?id=1929326#c9
12951295 // Must never be set to undefined!
@@ -1301,7 +1301,7 @@ async function diffUpdater() {
13011301 return ;
13021302 }
13031303 if ( data . status === 'updated' ) {
1304- adnLog ( `Diff updater: successfully patched ${ data . assetKey } using ${ data . patchURL } (${ data . patchSize } )` ) ;
1304+ adnlog ( `Diff updater: successfully patched ${ data . assetKey } using ${ data . patchURL } (${ data . patchSize } )` ) ;
13051305 const metadata = extractMetadataFromList ( data . text , [
13061306 'Last-Modified' ,
13071307 'Expires' ,
@@ -1316,44 +1316,44 @@ async function diffUpdater() {
13161316 assetCacheSetDetails ( data . assetKey , metadata ) ;
13171317 updaterUpdated . push ( data . assetKey ) ;
13181318 } else if ( data . error ) {
1319- adnLog ( `Diff updater: failed to update ${ data . assetKey } using ${ data . patchPath } \n\treason: ${ data . error } ` ) ;
1319+ adnlog ( `Diff updater: failed to update ${ data . assetKey } using ${ data . patchPath } \n\treason: ${ data . error } ` ) ;
13201320 } else if ( data . status === 'nopatch-yet' || data . status === 'nodiff' ) {
1321- adnLog ( `Diff updater: skip update of ${ data . assetKey } using ${ data . patchPath } \n\treason: ${ data . status } ` ) ;
1321+ adnlog ( `Diff updater: skip update of ${ data . assetKey } using ${ data . patchPath } \n\treason: ${ data . status } ` ) ;
13221322 assetCacheSetDetails ( data . assetKey , { writeTime : data . writeTime } ) ;
13231323 broadcast ( {
13241324 what : 'assetUpdated' ,
13251325 key : data . assetKey ,
13261326 cached : true ,
13271327 } ) ;
13281328 } else {
1329- adnLog ( `Diff updater: ${ data . assetKey } / ${ data . patchPath } / ${ data . status } ` ) ;
1329+ adnlog ( `Diff updater: ${ data . assetKey } / ${ data . patchPath } / ${ data . status } ` ) ;
13301330 }
13311331 pendingOps -= 1 ;
13321332 if ( pendingOps === 0 && toSoftUpdate . length !== 0 ) {
1333- adnLog ( 'Diff updater: soft updating' , toSoftUpdate . map ( v => v . assetKey ) . join ( ) ) ;
1333+ adnlog ( 'Diff updater: soft updating' , toSoftUpdate . map ( v => v . assetKey ) . join ( ) ) ;
13341334 while ( toSoftUpdate . length !== 0 ) {
13351335 bc . postMessage ( toSoftUpdate . shift ( ) ) ;
13361336 pendingOps += 1 ;
13371337 }
13381338 }
13391339 if ( pendingOps !== 0 ) { return ; }
1340- adnLog ( 'Diff updater: cycle complete' ) ;
1340+ adnlog ( 'Diff updater: cycle complete' ) ;
13411341 terminate ( ) ;
13421342 } ;
13431343 const worker = new Worker ( 'js/diff-updater.js' ) ;
13441344 } ) . catch ( reason => {
1345- adnLog ( `Diff updater: ${ reason } ` ) ;
1345+ adnlog ( `Diff updater: ${ reason } ` ) ;
13461346 } ) ;
13471347}
13481348
13491349function updateFirst ( ) {
1350- adnLog ( 'Updater: cycle start' ) ;
1351- adnLog ( 'Updater: prefer' , updaterAuto ? 'CDNs' : 'origin' ) ;
1350+ adnlog ( 'Updater: cycle start' ) ;
1351+ adnlog ( 'Updater: prefer' , updaterAuto ? 'CDNs' : 'origin' ) ;
13521352 updaterStatus = 'updating' ;
13531353 updaterFetched . clear ( ) ;
13541354 updaterUpdated . length = 0 ;
13551355 diffUpdater ( ) . catch ( reason => {
1356- adnLog ( reason ) ;
1356+ adnlog ( reason ) ;
13571357 } ) . finally ( ( ) => {
13581358 updateNext ( ) ;
13591359 } ) ;
@@ -1427,10 +1427,10 @@ async function updateNext() {
14271427 remoteServerFriendly = false ;
14281428
14291429 if ( result . error ) {
1430- adnLog ( `Full updater: failed to update ${ assetKey } ` ) ;
1430+ adnlog ( `Full updater: failed to update ${ assetKey } ` ) ;
14311431 fireNotification ( 'asset-update-failed' , { assetKey : result . assetKey } ) ;
14321432 } else {
1433- adnLog ( `Full updater: successfully updated ${ assetKey } ` ) ;
1433+ adnlog ( `Full updater: successfully updated ${ assetKey } ` ) ;
14341434 updaterUpdated . push ( result . assetKey ) ;
14351435 if ( result . assetKey === 'assets.json' && result . content !== '' ) {
14361436 updateAssetSourceRegistry ( result . content ) ;
@@ -1449,9 +1449,9 @@ function updateDone() {
14491449 updaterStatus = undefined ;
14501450 updaterAuto = false ;
14511451 updaterAssetDelay = updaterAssetDelayDefault ;
1452- adnLog ( 'Updater: cycle end' ) ;
1452+ adnlog ( 'Updater: cycle end' ) ;
14531453 if ( assetKeys . length ) {
1454- adnLog ( `Updater: ${ assetKeys . join ( ) } were updated` ) ;
1454+ adnlog ( `Updater: ${ assetKeys . join ( ) } were updated` ) ;
14551455 }
14561456 fireNotification ( 'after-assets-updated' , { assetKeys } ) ;
14571457}
0 commit comments