From 226302d631834bfd74139496e52627a4b001b69711e6738d4dd3acdac3cd176e Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Sat, 23 Sep 2023 07:28:40 +0000 Subject: [PATCH] Accepting request 1113090 from home:biggestsonicfan:branches:mozilla:Factory Fixes 1822730, which will be blocked from merging until 1768383 is resolved. OBS-URL: https://build.opensuse.org/request/show/1113090 OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=1106 --- MozillaFirefox.spec | 1 + mozilla-bmo1822730.patch | 52 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 mozilla-bmo1822730.patch diff --git a/MozillaFirefox.spec b/MozillaFirefox.spec index 16881a9..7315af7 100644 --- a/MozillaFirefox.spec +++ b/MozillaFirefox.spec @@ -228,6 +228,7 @@ Patch20: one_swizzle_to_rule_them_all.patch Patch21: svg-rendering.patch Patch22: mozilla-partial-revert-1768632.patch Patch23: mozilla-rust-disable-future-incompat.patch +Patch24: mozilla-bmo1822730.patch # Firefox/browser Patch101: firefox-kde.patch Patch102: firefox-branded-icons.patch diff --git a/mozilla-bmo1822730.patch b/mozilla-bmo1822730.patch new file mode 100644 index 0000000..33d2882 --- /dev/null +++ b/mozilla-bmo1822730.patch @@ -0,0 +1,52 @@ +# HG changeset patch +# User Rob Krum +# Date 1695432215 25200 +# Fri Sep 22 18:23:35 2023 -0700 +# Node ID e6a8a9f0956d124e8de34eb4bcf09d8e17077d9d +# Parent 677cbf2e64cdcd3a93e644f781be2bdc2529ba1a +Bug 1822730 - Add basic blob protocol handling for blob URIs that contain parsable http/s protocols + +diff --git a/toolkit/mozapps/downloads/DownloadLastDir.sys.mjs b/toolkit/mozapps/downloads/DownloadLastDir.sys.mjs +--- a/toolkit/mozapps/downloads/DownloadLastDir.sys.mjs ++++ b/toolkit/mozapps/downloads/DownloadLastDir.sys.mjs +@@ -221,11 +221,13 @@ export class DownloadLastDir { + + /** + * Pre-processor to extract a domain name to be used with the content-prefs +- * service. This specially handles data and file URIs so that the download +- * dirs are recalled in a more consistent way: ++ * service. This specially handles data, file and blob URIs so that the ++ * download dirs are recalled in a more consistent way: + * - all file:/// URIs share the same folder + * - data: URIs share a folder per mime-type. If a mime-type is not + * specified text/plain is assumed. ++ * - blob: blob URIs are tested for http/https and the blob protocol ++ * is stripped. + * In any other case the original URL is returned as a string and ContentPrefs + * will do its usual parsing. + * +@@ -234,6 +236,9 @@ export class DownloadLastDir { + */ + #cpsGroupFromURL(url) { + if (typeof url == "string") { ++ if (url.startsWith("blob:http://") || url.startsWith("blob:https://")) { ++ url = url.replace("blob:", ""); ++ } + url = new URL(url); + } else if (url instanceof Ci.nsIURI) { + url = URL.fromURI(url); +@@ -241,6 +246,14 @@ export class DownloadLastDir { + if (!URL.isInstance(url)) { + return url; + } ++ if (url.protocol == "blob:") { ++ if ( ++ url.href.startsWith("blob:http://") || ++ url.href.startsWith("blob:https://") ++ ) { ++ return url.href.replace("blob:", ""); ++ } ++ } + if (url.protocol == "data:") { + return url.href.match(/^data:[^;,]*/i)[0].replace(/:$/, ":text/plain"); + }