mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Force all dev builds to use assets.dev.json
This commit is contained in:
parent
f6839f5a57
commit
fd821e3473
1 changed files with 12 additions and 2 deletions
|
|
@ -815,7 +815,7 @@ const getRemote = async function(assetKey) {
|
||||||
const assetDetails = assetRegistry[assetKey] || {};
|
const assetDetails = assetRegistry[assetKey] || {};
|
||||||
|
|
||||||
const reportBack = function(content, err) {
|
const reportBack = function(content, err) {
|
||||||
const details = { assetKey: assetKey, content: content };
|
const details = { assetKey, content };
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
details.error = assetDetails.lastError = err;
|
details.error = assetDetails.lastError = err;
|
||||||
} else {
|
} 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; }
|
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'
|
const result = assetDetails.content === 'filters'
|
||||||
? await assets.fetchFilterList(contentURL)
|
? await assets.fetchFilterList(contentURL)
|
||||||
: await assets.fetchText(contentURL);
|
: await assets.fetchText(contentURL);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue