mirror of https://github.com/gorhill/uBlock.git
Extract list name from hash portion of `! Diff-Path:`
This commit is contained in:
parent
b7bb26807d
commit
aeff955667
|
@ -49,8 +49,7 @@ const basename = url => {
|
||||||
|
|
||||||
const resolveURL = (path, url) => {
|
const resolveURL = (path, url) => {
|
||||||
try {
|
try {
|
||||||
const urlAfter = new URL(path, url);
|
return new URL(path, url);
|
||||||
return urlAfter.href;
|
|
||||||
}
|
}
|
||||||
catch(_) {
|
catch(_) {
|
||||||
}
|
}
|
||||||
|
@ -201,8 +200,11 @@ async function fetchPatchDetailsFromCDNs(assetDetails) {
|
||||||
if ( response.ok !== true ) { continue; }
|
if ( response.ok !== true ) { continue; }
|
||||||
const patchText = await response.text();
|
const patchText = await response.text();
|
||||||
const patchDetails = parsePatch(patchText);
|
const patchDetails = parsePatch(patchText);
|
||||||
|
if ( patchURL.hash.length > 1 ) {
|
||||||
|
assetDetails.diffName = patchURL.hash.slice(1);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
patchURL,
|
patchURL: patchURL.href,
|
||||||
patchSize: `${(patchText.length / 1000).toFixed(1)} KB`,
|
patchSize: `${(patchText.length / 1000).toFixed(1)} KB`,
|
||||||
patchDetails,
|
patchDetails,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue