Find Full Text: Support Atypon (#4397)
Don't remove all query strings when normalizing URLs - keep 'download' so that Atypon PDFs/EPUBs resolve correctly.
This commit is contained in:
parent
7020d60351
commit
629c5ecab2
1 changed files with 9 additions and 1 deletions
|
@ -1883,7 +1883,15 @@ Zotero.Attachments = new function () {
|
|||
// Don't try the same normalized URL more than once
|
||||
var triedURLs = new Set();
|
||||
function normalizeURL(url) {
|
||||
return url.replace(/\?.*/, '');
|
||||
url = new URL(url);
|
||||
for (let param of Array.from(url.searchParams.keys())) {
|
||||
// Keep 'download' param for Atypon
|
||||
if (param !== 'download') {
|
||||
url.searchParams.delete(param);
|
||||
}
|
||||
}
|
||||
url.searchParams.sort();
|
||||
return url.toString();
|
||||
}
|
||||
function isTriedURL(url) {
|
||||
return triedURLs.has(normalizeURL(url));
|
||||
|
|
Loading…
Reference in a new issue