mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #18430 from Snuffleupagus/pr-18417-followup
Fix `DOMFilterFactory.#createUrl` in MOZCENTRAL builds (18417 PR follow-up)
This commit is contained in:
commit
f9e3b6bcc4
1 changed files with 8 additions and 10 deletions
|
@ -124,22 +124,20 @@ class DOMFilterFactory extends BaseFilterFactory {
|
|||
}
|
||||
|
||||
#createUrl(id) {
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
if (this.#baseUrl === undefined) {
|
||||
const url = this.#document.URL;
|
||||
if (url === this.#document.baseURI) {
|
||||
// No `<base>`-element present, hence a relative URL should work.
|
||||
this.#baseUrl = "";
|
||||
} else if (isDataScheme(url)) {
|
||||
if (this.#baseUrl === undefined) {
|
||||
// Unless a `<base>`-element is present a relative URL should work.
|
||||
this.#baseUrl = "";
|
||||
|
||||
const url = this.#document.URL;
|
||||
if (url !== this.#document.baseURI) {
|
||||
if (isDataScheme(url)) {
|
||||
warn('#createUrl: ignore "data:"-URL for performance reasons.');
|
||||
this.#baseUrl = "";
|
||||
} else {
|
||||
this.#baseUrl = url.split("#", 1)[0];
|
||||
}
|
||||
}
|
||||
return `url(${this.#baseUrl}#${id})`;
|
||||
}
|
||||
return `url(${id})`;
|
||||
return `url(${this.#baseUrl}#${id})`;
|
||||
}
|
||||
|
||||
addFilter(maps) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue