diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/newtab/tools | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/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.js | 9 |
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; |