From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- browser/components/newtab/tools/resourceUriPlugin.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'browser/components/newtab/tools/resourceUriPlugin.js') 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; -- cgit v1.2.3