Skip to content

Commit 9967ab4

Browse files
Merge pull request #19657 from Snuffleupagus/GenericL10n-rm-regex
Replace the regular expression in `GenericL10n.#getPaths` with simple string parsing
2 parents 2294a51 + 9180e27 commit 9967ab4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

web/genericl10n.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ class GenericL10n extends L10n {
121121
const { href } = document.querySelector(`link[type="application/l10n"]`);
122122
const paths = await fetchData(href, /* type = */ "json");
123123

124-
return { baseURL: href.replace(/[^/]*$/, "") || "./", paths };
124+
return {
125+
baseURL: href.substring(0, href.lastIndexOf("/") + 1) || "./",
126+
paths,
127+
};
125128
} catch {}
126129
return { baseURL: "./", paths: Object.create(null) };
127130
}

0 commit comments

Comments
 (0)