From fd821e347349d849906caad4ad77b9aaadab28fc Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 8 May 2023 08:23:19 -0400 Subject: [PATCH] Force all dev builds to use assets.dev.json --- src/js/assets.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/js/assets.js b/src/js/assets.js index f7aa67c38..4571a577a 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -815,7 +815,7 @@ const getRemote = async function(assetKey) { const assetDetails = assetRegistry[assetKey] || {}; const reportBack = function(content, err) { - const details = { assetKey: assetKey, content: content }; + const details = { assetKey, content }; if ( err ) { details.error = assetDetails.lastError = err; } else { @@ -851,9 +851,19 @@ const getRemote = async function(assetKey) { } } - for ( const contentURL of contentURLs ) { + for ( let contentURL of contentURLs ) { if ( reIsExternalPath.test(contentURL) === false ) { continue; } + // This will force uBO to fetch the proper version according to whether + // the dev build is being used. This can be removed when execution of + // this code path is widespread for dev build revisions of uBO. + if ( assetKey === 'assets.json' ) { + contentURL = contentURL.replace( + /\/assets\/assets\.json$/, + µb.assetsJsonPath + ); + } + const result = assetDetails.content === 'filters' ? await assets.fetchFilterList(contentURL) : await assets.fetchText(contentURL);