Skip to content

Commit 9180e27

Browse files
committed
Replace the regular expression in GenericL10n.#getPaths with simple string parsing
1 parent 2294a51 commit 9180e27

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)