Open Bug 1205066 Opened 11 years ago Updated 4 years ago

nsMacShellService::SetDefaultBrowser throws

Categories

(Firefox :: Shell Integration, defect, P5)

defect

Tracking

()

Tracking Status
firefox43 --- affected

People

(Reporter: Dolske, Unassigned)

References

Details

While investigating bug 1205038, I noticed that the timer for the BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS probe wasn't firing (we use this to poll for if the OS's default browser prompt was successfully interacted with by the user, especially on Windows 10). A little debugging shows that nsMacShellService::SetDefaultBrowser is throwing, and so the rest of DefaultBrowserCheck.setAsDefault() in nsBrowserGlue never runs. :( The shell service fails here: ... 79 if (::LSSetDefaultHandlerForURLScheme(CFSTR("http"), firefoxID) != noErr) { 80 return NS_ERROR_FAILURE; 81 } 82 if (::LSSetDefaultHandlerForURLScheme(CFSTR("https"), firefoxID) != noErr) { 83 return NS_ERROR_FAILURE; 84 } ... The first call succeeds, triggering the OS's "Do you want to change your default web browser to “FirefoxDebug” or keep using “Nightly”?" prompt. The second call fails, return -54 [which seems to be a generic "permission denied" error, according to macerror()?]. Unless there's a more modern replacement for ::LSSetDefaultHandlerForURLScheme, we should just ignore failures from the 2nd call? But what's actually happening here? Does this mean we only end up registering for "http", and "https" can still be handed by a different browser? Or does OS X end up using the same one for both?
I see there's also some related history in bug 1063529.
Component: General → Shell Integration
(In reply to Justin Dolske [:Dolske] from comment #0) > While investigating bug 1205038, I noticed that the timer for the > BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS probe wasn't firing (we use > this to poll for if the OS's default browser prompt was successfully > interacted with by the user, especially on Windows 10). > > A little debugging shows that nsMacShellService::SetDefaultBrowser is > throwing, and so the rest of DefaultBrowserCheck.setAsDefault() in > nsBrowserGlue never runs. :( > > The shell service fails here: > > ... > 79 if (::LSSetDefaultHandlerForURLScheme(CFSTR("http"), firefoxID) != > noErr) { > 80 return NS_ERROR_FAILURE; > 81 } > 82 if (::LSSetDefaultHandlerForURLScheme(CFSTR("https"), firefoxID) != > noErr) { > 83 return NS_ERROR_FAILURE; > 84 } > ... > > The first call succeeds, triggering the OS's "Do you want to change your > default web browser to “FirefoxDebug” or keep using “Nightly”?" prompt. The > second call fails, return -54 [which seems to be a generic "permission > denied" error, according to macerror()?]. > > Unless there's a more modern replacement for > ::LSSetDefaultHandlerForURLScheme, we should just ignore failures from the > 2nd call? We could do on yosemite and later, though I expect the FTP one might fail, too. > But what's actually happening here? Does this mean we only end up > registering for "http", and "https" can still be handed by a different > browser? Or does OS X end up using the same one for both? https://bugzilla.mozilla.org/show_bug.cgi?id=1063529#c20 answers this (we register for both if you go through the dialog successfully).
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.