mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1170803 - Only check for all filetype associations in Windows versions preceding 8.0 to match the startup behavior. r=Gijs
This commit is contained in:
parent
c92d0561a7
commit
dd2af53e73
@ -687,6 +687,28 @@ var gMainPane = {
|
||||
* occurs at startup, false otherwise
|
||||
*/
|
||||
|
||||
/**
|
||||
* Firefox can attempt to set itself as the default application
|
||||
* for all related filetypes or just for HTML. Some platforms
|
||||
* such as Windows have terrible UIs for all filetypes. In those
|
||||
* platforms, Firefox only attempts to associate itself with HTML.
|
||||
*/
|
||||
shouldClaimAllTypes: function()
|
||||
{
|
||||
let claimAllTypes = true;
|
||||
try {
|
||||
if (AppConstants.platform == "win") {
|
||||
// In Windows 8+, the UI for selecting default protocol is much
|
||||
// nicer than the UI for setting file type associations. So we
|
||||
// only show the protocol association screen on Windows 8+.
|
||||
// Windows 8 is version 6.2.
|
||||
let version = Services.sysinfo.getProperty("version");
|
||||
claimAllTypes = (parseFloat(version) < 6.2);
|
||||
}
|
||||
} catch (ex) {}
|
||||
return claimAllTypes;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show button for setting browser as default browser or information that
|
||||
* browser is already the default browser.
|
||||
@ -700,7 +722,8 @@ var gMainPane = {
|
||||
return;
|
||||
}
|
||||
let setDefaultPane = document.getElementById("setDefaultPane");
|
||||
let selectedIndex = shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
|
||||
let claimAllTypes = gMainPane.shouldClaimAllTypes();
|
||||
let selectedIndex = shellSvc.isDefaultBrowser(false, claimAllTypes) ? 1 : 0;
|
||||
setDefaultPane.selectedIndex = selectedIndex;
|
||||
},
|
||||
|
||||
@ -713,15 +736,7 @@ var gMainPane = {
|
||||
if (!shellSvc)
|
||||
return;
|
||||
try {
|
||||
let claimAllTypes = true;
|
||||
if (AppConstants.platform == "win") {
|
||||
// In Windows 8+, the UI for selecting default protocol is much
|
||||
// nicer than the UI for setting file type associations. So we
|
||||
// only show the protocol association screen on Windows 8+.
|
||||
// Windows 8 is version 6.2.
|
||||
let version = Services.sysinfo.getProperty("version");
|
||||
claimAllTypes = (parseFloat(version) < 6.2);
|
||||
}
|
||||
let claimAllTypes = gMainPane.shouldClaimAllTypes();
|
||||
shellSvc.setDefaultBrowser(claimAllTypes, false);
|
||||
} catch (ex) {
|
||||
Cu.reportError(ex);
|
||||
|
Loading…
Reference in New Issue
Block a user