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) => {
|
||||
try {
|
||||
const urlAfter = new URL(path, url);
|
||||
return urlAfter.href;
|
||||
return new URL(path, url);
|
||||
}
|
||||
catch(_) {
|
||||
}
|
||||
|
@ -201,8 +200,11 @@ async function fetchPatchDetailsFromCDNs(assetDetails) {
|
|||
if ( response.ok !== true ) { continue; }
|
||||
const patchText = await response.text();
|
||||
const patchDetails = parsePatch(patchText);
|
||||
if ( patchURL.hash.length > 1 ) {
|
||||
assetDetails.diffName = patchURL.hash.slice(1);
|
||||
}
|
||||
return {
|
||||
patchURL,
|
||||
patchURL: patchURL.href,
|
||||
patchSize: `${(patchText.length / 1000).toFixed(1)} KB`,
|
||||
patchDetails,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue