From eb06ba482c27a82d4c855facd567a84d86f7d54f604b601e8c9b88e829313de0 Mon Sep 17 00:00:00 2001 From: Wolfgang Rosenauer Date: Thu, 24 Mar 2022 22:11:50 +0000 Subject: [PATCH] Accepting request 964625 from home:DarkWav Change mozilla-kde.patch to follow the GNOME registry behavior for new MIME types to avoid opening downloaded files without any inquiries (bsc#1197319) In Firefox 98.0, improvements to the download panel have been made to just download files instead of asking the user what to do with them. Unfortunately this causes some unwanted behavior inside nsKDERegistry as its unconditional call to the function mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); results in the browser opening many file types after download without any inquiries. By replacing this unconditional call with the conditional one found in nsGNOMERegistry as of 98.0, this issue can be avoided: https://github.com/mozilla/gecko-dev/blob/3b6a1dc7fb5b3e54b156b2396809ccfd15b9243f/uriloader/exthandler/unix/nsGNOMERegistry.cpp#L98 If you have any suggestions for improvement, please let me know! OBS-URL: https://build.opensuse.org/request/show/964625 OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=967 --- MozillaFirefox.changes | 7 +++++++ mozilla-kde.patch | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/MozillaFirefox.changes b/MozillaFirefox.changes index dbaf4fc3..98037165 100644 --- a/MozillaFirefox.changes +++ b/MozillaFirefox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 23 15:14:22 UTC 2022 - Simon Vogl + +- Change mozilla-kde.patch to follow the GNOME registry + behavior for new MIME types to avoid opening downloaded files + without any inquiries (bsc#1197319) + ------------------------------------------------------------------- Tue Mar 22 12:22:51 UTC 2022 - Guillaume GARDET diff --git a/mozilla-kde.patch b/mozilla-kde.patch index d6ff6b94..a7014ee6 100644 --- a/mozilla-kde.patch +++ b/mozilla-kde.patch @@ -941,12 +941,13 @@ diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/ new file mode 100644 --- /dev/null +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp -@@ -0,0 +1,86 @@ +@@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + ++#include "mozilla/StaticPrefs_browser.h" +#include "nsKDERegistry.h" +#include "prlink.h" +#include "prmem.h" @@ -1022,8 +1023,10 @@ new file mode 100644 + nsCString description = output[ 1 ]; + mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); + nsCString handlerAppName = output[ 2 ]; ++ mozilla::StaticPrefs::browser_download_improvements_to_download_panel() ++ ? mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk) ++ : mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); + mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); -+ mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); + return mimeInfo.forget(); + } + return nullptr;