Closed
      
        Bug 1190586
      
      
        Opened 10 years ago
          Closed 10 years ago
      
        
    
  
UITour should expose if default browser can be set w/o UI on Win8+
Categories
(Firefox :: Tours, defect, P3)
        Firefox
          
        
        
      
        
    
        Tours
          
        
        
      
        
    Tracking
()
        RESOLVED
        FIXED
        
    
  
        
            Firefox 43
        
    
  
People
(Reporter: Dolske, Assigned: jaws)
References
(Depends on 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
| 
        
        
         4.53 KB,
          patch         
       | 
      
           Dolske
 :
              
              review+
           | 
      Details | Diff | Splinter Review | 
Bug 1184508 added the ability on Windows 8+ to restore Firefox as the default browser, if it had previously been set as such, without triggering Window's own complex UI for setting a default app.
We should probably expose this through the tour API, so that support pages know what's actually going to happen when the user triggers the default browser change. Otherwise they'll appear to tell the user to brace themselves for Windows' UI, and they may be confused when it happens without seeing that.
| Assignee | ||
          Updated•10 years ago
           
         | 
      
Assignee: nobody → jaws
Status: NEW → ASSIGNED
| Assignee | ||
          Comment 1•10 years ago
           
         | 
      ||
        Attachment #8645728 -
        Flags: review?(dolske)
| Reporter | ||
          Comment 2•10 years ago
           
         | 
      ||
Comment on attachment 8645728 [details] [diff] [review]
Patch
Review of attachment 8645728 [details] [diff] [review]:
-----------------------------------------------------------------
::: browser/components/uitour/UITour.jsm
@@ +1820,5 @@
> +
> +        let canSetDefaultBrowserInBackground =
> +          AppConstants.platform != "win" ||
> +          !AppConstants.isPlatformAndVersionAtLeast("win", "6.2");
> +        if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
This can be simplified to just:
let canSet... = true;
if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
   ...
   canSet = prefChildren.length > 0;
}
That said...
OS X does have a system prompt (http://imgur.com/qoj7SWc). I think this is fairly new, 10.9 or 10.10? Should reflect that here.
Also, Linux is actually a little tricky because we may not have a suitable shell service that even allows setting it. Should probably just go ahead and return |false| here in such cases.
::: browser/components/uitour/test/browser_UITour_defaultBrowser.js
@@ +80,5 @@
> +  taskify(function* test_setInBackgroundWhenPrefExists(done) {
> +    gContentAPI.getConfiguration("appinfo", (data) => {
> +      let canSetInBackground = false;
> +      is(canSetInBackground, data.canSetDefaultBrowserInBackground,
> +        "canSetDefaultBrowserInBackground should be false when no hashes are present");
Err, won't this end up failing on not-Windows?
        Attachment #8645728 -
        Flags: review?(dolske) → review-
| Reporter | ||
          Updated•10 years ago
           
         | 
      
Priority: -- → P3
| Assignee | ||
          Comment 3•10 years ago
           
         | 
      ||
I looked online and found that OSX introduced that prompt in 10.10, https://www.aeyoun.com/posts/osx-protect-default-browser.html
I changed the code so that canSetDefaultBrowserInBackground is null on Linux when the shell service is unavailable. 
Try push, https://treeherder.mozilla.org/#/jobs?repo=try&revision=fbb251a421bd
        Attachment #8645728 -
        Attachment is obsolete: true
        Attachment #8649086 -
        Flags: review?(dolske)
| Assignee | ||
          Comment 4•10 years ago
           
         | 
      ||
        Attachment #8649086 -
        Attachment is obsolete: true
        Attachment #8649086 -
        Flags: review?(dolske)
        Attachment #8649371 -
        Flags: review?(dolske)
| Assignee | ||
          Comment 5•10 years ago
           
         | 
      ||
        Attachment #8649371 -
        Attachment is obsolete: true
        Attachment #8649371 -
        Flags: review?(dolske)
        Attachment #8649611 -
        Flags: review?(dolske)
| Reporter | ||
          Updated•10 years ago
           
         | 
      
        Attachment #8649611 -
        Flags: review?(dolske) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
          status-firefox43:
          --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
          Comment 8•10 years ago
           
         | 
      ||
>          canSetDefaultBrowserInBackground = prefChildren.length > 0;
It should be |prefChildren.length >= 4|. setDefaultBrowser(true, false) will trigger the Windows UI if it can't set any one of http, https, .html, and .htm.
          Updated•9 years ago
           
         | 
      
Flags: qe-verify+
          Comment 9•9 years ago
           
         | 
      ||
I see that the same UITour (the one with 3 easy steps) prompted on both Firefox 42.0 RC and 43 beta 2 when none of them are set as default, and they have been earlier but switched with chrome. If both 42 and 43 are set as default browsers I will get another UITour (the one with Privacy, Speed and Choice). So judging by the tracking flags, 42 should be bad and 43 should be good but I can't spot any difference between the behaviour from both versions. 
Is there something I'm missing? Or am I checking the wrong thing here? requesting needinfo from Masatosi Kimura since he verified bug 1184508 as well.
Flags: needinfo?(VYV03354)
          Comment 10•9 years ago
           
         | 
      ||
(In reply to Bogdan Maris, QA [:bogdan_maris] from comment #9)
> I see that the same UITour (the one with 3 easy steps) prompted on both
> Firefox 42.0 RC and 43 beta 2 when none of them are set as default, and they
> have been earlier but switched with chrome. If both 42 and 43 are set as
> default browsers I will get another UITour (the one with Privacy, Speed and
> Choice). So judging by the tracking flags, 42 should be bad and 43 should be
> good but I can't spot any difference between the behaviour from both
> versions. 
> 
> Is there something I'm missing? Or am I checking the wrong thing here?
> requesting needinfo from Masatosi Kimura since he verified bug 1184508 as
> well.
This bug has yet to be implemented on those pages in production.
          You need to log in
          before you can comment on or make changes to this bug.
        
Description
•