diff options
author | Thomas Groman <tgroman@nuegia.net> | 2020-04-24 22:38:11 -0700 |
---|---|---|
committer | Thomas Groman <tgroman@nuegia.net> | 2020-04-24 22:38:11 -0700 |
commit | ae79f996db5cec04999d164552b75b3366cfa54a (patch) | |
tree | fb99fc72ddb1aef3b499fba70d5108b845763677 /webbrowser/components/shell/ShellService.jsm | |
parent | 8baf7f428b67d4797719f8b011b327cfc93c040f (diff) | |
download | webbrowser-ae79f996db5cec04999d164552b75b3366cfa54a.tar webbrowser-ae79f996db5cec04999d164552b75b3366cfa54a.tar.gz webbrowser-ae79f996db5cec04999d164552b75b3366cfa54a.tar.lz webbrowser-ae79f996db5cec04999d164552b75b3366cfa54a.tar.xz webbrowser-ae79f996db5cec04999d164552b75b3366cfa54a.zip |
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
Diffstat (limited to 'webbrowser/components/shell/ShellService.jsm')
-rw-r--r-- | webbrowser/components/shell/ShellService.jsm | 33 |
1 files changed, 6 insertions, 27 deletions
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; }, |