checkbox use firefox instead default browser

Bug #562580 reported by Guria on 2010-04-13
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Low
Marc Tardif
checkbox (Ubuntu)
Low
Marc Tardif
Lucid
Undecided
Unassigned

Bug Description

The impact of this bug is that the preferred browser is not always called because of a race condition. The fix consists of using wait() instead of the returncode variable when communicating with gconftool to get the preferred browser configuration.

Binary package hint: checkbox

Checkbox-gtk starts Firefox for viewing summary report instead of my Chromium which is my default browser.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: checkbox-gtk 0.9.1
ProcVersionSignature: Ubuntu 2.6.32-20.30-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-20-generic i686
Architecture: i386
CheckboxSubmission: 029094b2b2c6cef5d8b8f52ffc2e6db3
CheckboxSystem: 760a9c763ec0b6a7c358c7c2b598e135
Date: Wed Apr 14 01:13:14 2010
InstallationMedia: Error: [Errno 13] Отказано в доступе: '/var/log/installer/media-info'
PackageArchitecture: all
ProcEnviron:
 LANG=ru_RU.utf8
 SHELL=/bin/bash
SourcePackage: checkbox

Related branches

Guria (guria) wrote :
David Murphy (schwuk) on 2010-04-14
Changed in checkbox (Ubuntu):
status: New → Confirmed
Marc Tardif (cr3) wrote :

The problem is that checkbox-gtk calls upon gnome-open in order to open the summary report. If the report were available under an http scheme, then chromium would most likely be called. However, since the report is under a file scheme because it is only available on the local filesystem, gnome-open seems to prefer using firefox instead.

David Murphy (schwuk) wrote :

As Marc says, the issue is that when we call `gnome-open` with a URL that uses the file scheme, gvfs uses the MIME type of the local submission report (application/xml) to determine which application should be used. In this case, firefox.desktop remains the default application for XML files even if you have set another browser to be your default.

Realistic solutions for this bug could be:

 * Bypass - use an internal browser (WebKit) to render the submission report
 * Embrace - generate a HTML representation of the report

Any other suggestions?

David Murphy (schwuk) on 2010-04-14
Changed in checkbox:
importance: Undecided → Low
status: New → Confirmed
Changed in checkbox (Ubuntu):
importance: Undecided → Low
Marc Tardif (cr3) wrote :

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: nobody → Marc Tardif (cr3)
Changed in checkbox (Ubuntu):
status: Confirmed → Fix Committed
assignee: nobody → Marc Tardif (cr3)
Changed in checkbox:
status: Confirmed → Fix Committed
David Murphy (schwuk) wrote :

We might need to revisit this fix Marc.

While I can confirm your fix works, and the submission.xml is correctly opened in my default browser (Google Chrome), Chrome has security restrictions that prevents an XML file referencing an XSLT file when using the file scheme, which results in a blank page with no warning/message etc.

This is a sub-optimal experience, and one that we need to avoid considering the continuing increase in popularity of Chrome/Chromium.

 * http://code.google.com/p/chromium/issues/detail?id=39616
 * https://groups.google.com/a/chromium.org/group/chromium-extensions/browse_thread/thread/da2761537faf2409

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.10

---------------
checkbox (0.10) maverick; urgency=low

  New upstream release (LP: #585132):
  * Added media tests (LP: #397944)
  * Added support for comments in templates.
  * Added referer when sending submissions to Launchpad (LP: #550973)
  * Added suggests to checkbox package in debian/control file (LP: #352740)
  * Fixed udev_resource script to be more resilient (LP: #556824)
  * Fixed cdimage_resource script to read casper.log (LP: #558728)
  * Fixed reporting all resources found for a job (LP: #560948)
  * Fixed stalling when using kdesudo to start backend (LP: #557443)
  * Fixed starting the appropriate default browser on UNR (LP: #563050)
  * Fixed ansi_parser script when outputting to stdout (LP: #560952)
  * Fixed opening the report with the gconf preferred browser (LP: #562580)
  * Fixed suspend_test to use relative time for wakealarm (LP: #349768)
  * Fixed backend not getting terminated upon closing (LP: #553328)
 -- Marc Tardif <email address hidden> Tue, 06 Apr 2010 14:17:46 -0400

Changed in checkbox (Ubuntu):
status: Fix Committed → Fix Released
Marc Tardif (cr3) on 2010-06-10
Changed in checkbox:
status: Fix Committed → Fix Released
Marc Tardif (cr3) on 2010-06-10
Changed in checkbox (Ubuntu Lucid):
milestone: none → lucid-updates
status: New → In Progress
Marc Tardif (cr3) on 2010-06-10
description: updated
Daniel Manrique (roadmr) wrote :

Hello, the following information should complete this bug as a valid SRU report, to hopefully upload this fix to Lucid.

Solution:
Checkbox revision 793 uses wait() instead of the returncode variable when communicating with gconftool to get the preferred browser configuration. This works because subprocess.Popen can potentially return before the process has finished, in which case we won't get the data we need, but using wait() guarantees that the Popened process will have finished by the time we read its output.

TEST CASE:

1- Perform a fresh 10.04 installation.
2- apt-get install chromium-browser.
3- Configure Chromium as default browser in System -> Preferred Aplications.
4- Launch system testing.
5- Do a test run (deselect all tests in the selection screen to run this faster).
6- Click on "View report" in the summary screen.

Even though Chromium was configured as default browser, Firefox launches and shows the report.

Regression potential:
Virtually none, the initial code didn't wait for gconftool to finish, which was incorrect behavior, fixed by this. About the only case when a user could be negatively impacted by this is if gconftool hangs; previously, this would result in Firefox launching with the report, whereas now the program will wait until gconftool has finished to launch the report, so a gconftool hang will keep the user waiting for the report. Also, if the user had configured a broken or invalid browser, the old behaviour would have been more desirable, but this is an extremely unlikely scenario.

Ara Pulido (ara) wrote :

This bug is awaiting verification that the checkbox version in lucid-proposed solves the problem. Please test checkbox and update this bug with the results. If the problem is solved, change the tag 'verification-needed' to 'verification-done'.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed
Chris Halse Rogers (raof) wrote :

ubuntu-sru approved and reviewed. Please accept into lucid-proposed.

Hello Guria, or anyone else affected,

Accepted checkbox into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in checkbox (Ubuntu Lucid):
status: In Progress → Fix Committed
Chad A. Davis (chadadavis) wrote :

Verified fix from checkbox 0.9.2 on Lucid

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.9.2

---------------
checkbox (0.9.2) lucid-proposed; urgency=low

  New upstream release (LP: #567568):
  * Added referer when sending submissions to Launchpad (LP: #550973)
  * Added suggests to checkbox package in debian/control file (LP: #352740)
  * Fixed udev_resource script to be more resilient (LP: #556824)
  * Fixed cdimage_resource script to read casper.log (LP: #558728)
  * Fixed reporting all resources found for a job (LP: #560948)
  * Fixed stalling when using kdesudo to start backend (LP: #557443)
  * Fixed starting the appropriate default browser on UNR (LP: #563050)
  * Fixed opening the report with the gconf preferred browser (LP: #562580)
  * Fixed suspend_test to use relative time for wakealarm (LP: #349768)
  * Fixed backend not getting terminated upon closing (LP: #553328)
 -- Daniel Manrique <email address hidden> Wed, 22 Jun 2011 14:18:08 -0400

Changed in checkbox (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.