Skip to content

Commit

Permalink
feat(content_delegate): Use the URL constructor to return absolute URL
Browse files Browse the repository at this point in the history
Updates the extractURL method to generate absolute URLs instead of relative ones to fix the issue with document fetching in Firefox and employs regular expressions to refine the URL cleanup process.
  • Loading branch information
ERosendo committed Nov 17, 2023
1 parent 80204db commit 19d80da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/content_delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,10 @@ ContentDelegate.prototype.onDownloadAllSubmit = async function (event) {
return null;
}
// Clean the match found in the HTML
return showTempURL[0].replace(';"', '');
let relativePath = showTempURL[0].replace(/\"|;/, '');

// Use absolute paths to avoid issue with Firefox.
return new URL(relativePath, window.location);
};

// helper function - convert string to html document
Expand Down

0 comments on commit 19d80da

Please sign in to comment.