summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/tools
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /browser/components/newtab/tools
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/newtab/tools')
-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;