mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +02:00
Replace the regular expression in GenericL10n.#getPaths
with simple string parsing
This commit is contained in:
parent
2294a510b0
commit
9180e27f15
1 changed files with 4 additions and 1 deletions
|
@ -121,7 +121,10 @@ class GenericL10n extends L10n {
|
|||
const { href } = document.querySelector(`link[type="application/l10n"]`);
|
||||
const paths = await fetchData(href, /* type = */ "json");
|
||||
|
||||
return { baseURL: href.replace(/[^/]*$/, "") || "./", paths };
|
||||
return {
|
||||
baseURL: href.substring(0, href.lastIndexOf("/") + 1) || "./",
|
||||
paths,
|
||||
};
|
||||
} catch {}
|
||||
return { baseURL: "./", paths: Object.create(null) };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue