summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/tools/resourceUriPlugin.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /browser/components/newtab/tools/resourceUriPlugin.js
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/newtab/tools/resourceUriPlugin.js')
-rw-r--r--browser/components/newtab/tools/resourceUriPlugin.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/browser/components/newtab/tools/resourceUriPlugin.js b/browser/components/newtab/tools/resourceUriPlugin.js
index 938822f410..a2244f27fa 100644
--- a/browser/components/newtab/tools/resourceUriPlugin.js
+++ b/browser/components/newtab/tools/resourceUriPlugin.js
@@ -6,6 +6,8 @@
// and translating the uri into a relative filesytem path where the file may be
// found when running within the Karma / Mocha test framework.
+const path = require("path");
+
module.exports = {
ResourceUriPlugin: class ResourceUriPlugin {
/**
@@ -48,7 +50,12 @@ module.exports = {
if (!url.href.match(regex)) {
continue;
}
- const pathname = url.href.replace(regex, replacement);
+ // path.join() is necessary to normalize the path on Windows.
+ // Without it, the path may contain backslashes, resulting in
+ // different build output on Windows than on Unix systems.
+ const pathname = path.join(
+ url.href.replace(regex, replacement)
+ );
resourceData.path = pathname;
resourceData.query = url.search;
resourceData.fragment = url.hash;