When looking at this problem more closely, I found a couple problems
which actually provide a solution:

The first problem is that, even for known browsers like firefox and
epiphany, the following code does not necessarily get called:

                    gct = subprocess.Popen(sudo_prefix + ["gconftool", "--get",
                        "/desktop/gnome/url-handlers/http/command"],
                        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                    if gct.returncode == 0:

The reason is that returncode will be set to None until the process has
completed. Instead, the above conditionnal statement should be changed
to the following code in order to consider the output from gconftool:

                    if gct.wait() == 0:

The second problem, which depends on the above problem being fixed, is
that only firefox and epiphany are being treated specifically. The
reason is to make sure that another browser window gets opened instead
of a new tab being opened in a browser window in the background. So,
this code should remain the same but the http command should be
leveraged to open the corresponding browser:

                        subprocess.call(sudo_prefix + [preferred_browser % 
url], shell=True)
                        sys.exit(0)

Once both problems are solved, then the expected browser should be
called regardless of the extension or mime type of the given url.

** Changed in: checkbox
     Assignee: (unassigned) => Marc Tardif (cr3)

** Changed in: checkbox (Ubuntu)
       Status: Confirmed => Fix Committed

** Changed in: checkbox (Ubuntu)
     Assignee: (unassigned) => Marc Tardif (cr3)

** Branch linked: lp:~cr3/checkbox/562580

** Changed in: checkbox
       Status: Confirmed => Fix Committed

-- 
checkbox use firefox instead default browser
https://bugs.launchpad.net/bugs/562580
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to