From ae79f996db5cec04999d164552b75b3366cfa54a Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Fri, 24 Apr 2020 22:38:11 -0700 Subject: Remove AppConstants and do stuff in preproccessor, also remove unsupported OS code https://web.archive.org/web/20200425044233/https://github.com/MoonchildProductions/UXP/issues/65 --- webbrowser/components/shell/ShellService.jsm | 33 +++++----------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'webbrowser/components/shell/ShellService.jsm') diff --git a/webbrowser/components/shell/ShellService.jsm b/webbrowser/components/shell/ShellService.jsm index 74632b6..fecd7cb 100644 --- a/webbrowser/components/shell/ShellService.jsm +++ b/webbrowser/components/shell/ShellService.jsm @@ -1,14 +1,9 @@ -/* 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/. */ - "use strict"; this.EXPORTED_SYMBOLS = ["ShellService"]; const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; -Cu.import("resource://gre/modules/AppConstants.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry", @@ -26,27 +21,24 @@ var ShellServiceInternal = { * environments. */ get canSetDesktopBackground() { - if (AppConstants.platform == "win" || - AppConstants.platform == "macosx") { - return true; - } - - if (AppConstants.platform == "linux") { +#ifdef XP_LINUX if (this.shellService) { let linuxShellService = this.shellService .QueryInterface(Ci.nsIGNOMEShellService); return linuxShellService.canSetDesktopBackground; } - } - +#else return false; +#endif }, /** * Used to determine whether or not to show a "Set Default Browser" * query dialog. This attribute is true if the application is starting * up and "browser.shell.checkDefaultBrowser" is true, otherwise it - * is false. + * is false. I am open to removing this entirely. It's really not the + * browser's bussiness what the XDG or mailcap(5) preferences are. + * This is most likely legacy browser-wars marketing crap. */ _checkedThisSession: false, get shouldCheckDefaultBrowser() { @@ -60,19 +52,6 @@ var ShellServiceInternal = { return false; } - if (AppConstants.platform == "win") { - let optOutValue = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "Software\\Mozilla\\PaleMoon", - "DefaultBrowserOptOut"); - WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "Software\\Mozilla\\PaleMoon", - "DefaultBrowserOptOut"); - if (optOutValue == "True") { - Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", false); - return false; - } - } - return true; }, -- cgit v1.2.3