mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Fix DOMFilterFactory.#createUrl
in MOZCENTRAL builds (18417 PR follow-up)
Somehow I managed to mess up the URL creation relevant to e.g. MOZCENTRAL builds, which is breaking the pending PDF.js update in mozilla-central; sorry about that! To avoid future issues, we'll now always check if absolute filter-URLs are necessary regardless of the build-target.
This commit is contained in:
parent
87e74a753b
commit
4c45948bc4
1 changed files with 8 additions and 10 deletions
|
@ -124,22 +124,20 @@ class DOMFilterFactory extends BaseFilterFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
#createUrl(id) {
|
#createUrl(id) {
|
||||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
if (this.#baseUrl === undefined) {
|
||||||
if (this.#baseUrl === undefined) {
|
// Unless a `<base>`-element is present a relative URL should work.
|
||||||
const url = this.#document.URL;
|
this.#baseUrl = "";
|
||||||
if (url === this.#document.baseURI) {
|
|
||||||
// No `<base>`-element present, hence a relative URL should work.
|
const url = this.#document.URL;
|
||||||
this.#baseUrl = "";
|
if (url !== this.#document.baseURI) {
|
||||||
} else if (isDataScheme(url)) {
|
if (isDataScheme(url)) {
|
||||||
warn('#createUrl: ignore "data:"-URL for performance reasons.');
|
warn('#createUrl: ignore "data:"-URL for performance reasons.');
|
||||||
this.#baseUrl = "";
|
|
||||||
} else {
|
} else {
|
||||||
this.#baseUrl = url.split("#", 1)[0];
|
this.#baseUrl = url.split("#", 1)[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return `url(${this.#baseUrl}#${id})`;
|
|
||||||
}
|
}
|
||||||
return `url(${id})`;
|
return `url(${this.#baseUrl}#${id})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
addFilter(maps) {
|
addFilter(maps) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue