Regression: Firefox forgot how to open apt urls

Bug #1197559 reported by Alberto Salvia Novella
52
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Medium
One Hundred Papercuts
Fix Released
Medium
Unassigned
firefox (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

****************
HOW TO REPRODUCE
****************
- Open an apt url.

******************
EXPECTED BEHAVIOUR
******************
- The Software Center to be listed available to open the url.

**************
REAL BEHAVIOUR
**************
- No application is listed to open the url.

***********
WORK-AROUND
***********
- To select "/usr/bin/software-center" to open the url.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: firefox 22.0+build2-0ubuntu0.13.04.2
ProcVersionSignature: Ubuntu 3.8.0-25.37-generic 3.8.13
Uname: Linux 3.8.0-25-generic x86_64
AddonCompatCheckDisabled: False
ApportVersion: 2.9.2-0ubuntu8.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: es20490446e 3901 F.... pulseaudio
                      es20490446e 4580 F.... pulseaudio
BuildID: 20130627161625
Channel: Unavailable
Date: Thu Jul 4 00:26:39 2013
Extensions: extensions.sqlite corrupt or missing
ForcedLayersAccel: False
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
IncompatibleExtensions: Unavailable (corrupt or non-existant compatibility.ini or extensions.sqlite)
InstallationDate: Installed on 2013-01-25 (159 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
IpRoute:
 default via 192.168.1.1 dev wlan0 proto static
 169.254.0.0/16 dev wlan0 scope link metric 1000
 192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.102 metric 9
Locales: extensions.sqlite corrupt or missing
MarkForUpload: True
PrefSources:
 prefs.js
 [Profile]/<email address hidden>/defaults/preferences/prefs.js
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
Profiles: Profile0 (Default) - LastVersion=22.0/20130627161625 (In use)
RelatedPackageVersions:
 icedtea-7-plugin 1.3.2-1ubuntu1
 totem-mozilla 3.6.3-0ubuntu6
 rhythmbox-mozilla 2.98-0ubuntu5
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no
RunningIncompatibleAddons: False
SourcePackage: firefox
Themes: extensions.sqlite corrupt or missing
UpgradeStatus: Upgraded to raring on 2013-04-28 (66 days ago)
dmi.bios.date: 05/17/2011
dmi.bios.vendor: INSYDE
dmi.bios.version: 1.90
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: Base Board Product Name
dmi.board.vendor: Intel Corp.
dmi.board.version: Base Board Version
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: OEM Chassis Manufacturer
dmi.chassis.version: OEM Chassis Version
dmi.modalias: dmi:bvnINSYDE:bvr1.90:bd05/17/2011:svnTOSHIBA:pnSatelliteL750-114:pvrPSK1WE-01100ECE:rvnIntelCorp.:rnBaseBoardProductName:rvrBaseBoardVersion:cvnOEMChassisManufacturer:ct10:cvrOEMChassisVersion:
dmi.product.name: Satellite L750-114
dmi.product.version: PSK1WE-01100ECE
dmi.sys.vendor: TOSHIBA

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :
Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

Since this bug:

- Has a severe impact on a non-core application.
- Isn't easy to work-around for the user-base.

It has a priority of "medium".

Changed in firefox (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

Since this bug:

- Impacts the ease of use.
- Is easy to fix.
- Would be encountered by the average user in the default installation of the latest Ubuntu or Kubuntu desktop release.

It's a paper cut.

Revision history for this message
Shiba (shiba89) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Shiba (shiba89) wrote :

Also this is a regression introduced with the last updates.

Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

Status changed to 'Triaged' because the bug is:

- Valid.
- Well described.
- Reported in the upstream project.
- Ready to be worked on by a developer.

Changed in firefox (Ubuntu):
status: Confirmed → Triaged
Changed in hundredpapercuts:
assignee: nobody → Paper Cuts Ninja (papercuts-ninja)
Revision history for this message
In , Mathieu Comandon (strycore) wrote :

User Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36

Steps to reproduce:

Browsing on websites with a custom URL scheme which should open an external application when clicked (such as apt://, steam:// or magnet:// links).

Actual results:

Clicking on such links opens an empty dialog box and the user has to browse the file system to look for the executable, no default choice is proposed (since Firefox 22)

Expected results:

The Application Launch dialog used to show default application that could handle specific types of url schemes (Transmission for magnet: links, software center for apt: link, ...).

I ran a git bisect of revisions between Firefox 21 and Firefox 22 and found out that this was caused by the commit fixing bug #444440 (https://hg.mozilla.org/mozilla-central/rev/f118eb2326f7), reverting the commit did put the expected applications back in the dialog box, but doing so would reopen bug 444440. As I'm not familiar with the Firefox codebase, I didn't go as far as trying to write a patch that would solve both bugs, but ideally that's what would be needed here.

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

Mike?

Revision history for this message
In , Ritesh Khadgaray (khadgaray) wrote :

This seems to be a bug with gio handler

NS_IMETHODIMP
nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
{
...

  *_retval = false;
  nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
<--- we check for mime type, and not for protocol handler. The older code always would fall back to protocol handler based of mailcap.

  We need to fix GetFromType(mSchemeOrType), to handle scheme ( protocol).

This is seen from here

NS_IMETHODIMP
nsGIOService::GetAppForMimeType(const nsACString& aMimeType,
                                nsIGIOMimeApp** aApp)
{
...
  GAppInfo *app_info = g_app_info_get_default_for_type(content_type, false);
...
<-- We probably need to add g_app_info_get_default_for_uri_scheme () , if app_info is null.

untested though .

Revision history for this message
In , Josh Matthews (joshmatthews) wrote :

Ritesh, do you want to test your idea? https://developer.mozilla.org/en/Simple_Firefox_build should get you started, if you don't already have a local build.

Revision history for this message
In , Ritesh Khadgaray (khadgaray) wrote :

This indeed is the issue. Initial "patch" . Will post the final patch in a while ( rebuilding is a sloow process ).

--- a/uriloader/exthandler/unix/nsGNOMERegistry.cpp 2014-02-24 23:38:31.303287298 +0530
+++ b/uriloader/exthandler/unix/nsGNOMERegistry.cpp 2014-02-25 00:04:12.643350922 +0530
@@ -148,7 +148,12 @@ nsGNOMERegistry::GetFromType(const nsACS
     nsCOMPtr<nsIGIOMimeApp> gioHandlerApp;
     if (NS_FAILED(giovfs->GetAppForMimeType(aMIMEType, getter_AddRefs(gioHandlerApp))) ||
         !gioHandlerApp) {
- return nullptr;
+ // Unable to find mime handler, probably a protocol. moz bz#947868
+ // Need a better way to identify if this is a scheme - check for nsMIMEInfoBase::eProtocolInfo ?
+ if (NS_FAILED(giovfs->GetAppForURIScheme(aMIMEType, getter_AddRefs(gioHandlerApp))) ||
+ !gioHandlerApp) {
+ return nullptr;
+ }
     }
     gioHandlerApp->GetName(name);
     giovfs->GetDescriptionForMimeType(aMIMEType, description);

Revision history for this message
In , Ritesh Khadgaray (khadgaray) wrote :

Created attachment 8381136
proposed patch

nsGNOMERegistry::GetFromType only understands with mime detection, and not scheme handler detection.

Check if we are handling a scheme, if yes, call nsGNOMERegistry::HandlerExists

Changed in firefox:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Ritesh Khadgaray (khadgaray) wrote :
Revision history for this message
In , Ritesh Khadgaray (khadgaray) wrote :

Created attachment 8381157
protocol.patch

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "proposed patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in hundredpapercuts:
status: New → Triaged
importance: Undecided → Medium
assignee: Papercuts Ninjas (papercuts-ninja) → nobody
Revision history for this message
In , Josh Matthews (joshmatthews) wrote :

Comment on attachment 8381157
protocol.patch

Thanks Ritesh! hg tells me that Karl has reviewed changes to this file in the past, so let's see what he thinks.

Revision history for this message
In , Karlt (karlt) wrote :

Comment on attachment 8381157
protocol.patch

Looks good, thanks. Can you adjust the spacing a bit to match the surrounding code, as noted below, please?

>+
>+

Only one blank line, please.

>+ if ( mClass == eProtocolInfo ) {

No space after '(' or before ')'.
Only one space after "==".

>+ *_retval = nsGNOMERegistry::HandlerExists (mSchemeOrType.get());

No space before '('.

Revision history for this message
In , Ritesh Khadgaray (khadgaray) wrote :

Created attachment 8383597
protocol.patch

fixed.

Revision history for this message
In , Ryanvm (ryanvm) wrote :

https://hg.mozilla.org/integration/mozilla-inbound/rev/e1450dd6a960

Thanks for the patch, Ritesh! One small request - for future patches, please make sure that the commit information is included when you request checkin. Makes life easier for those landing on your behalf. Thanks again!
https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F

Revision history for this message
In , Ryanvm (ryanvm) wrote :
Changed in firefox:
status: New → Fix Released
Revision history for this message
In , Catalin-varga (catalin-varga) wrote :

Verified as fixed using the following environment:

FF 31.0b6
Build Id:20140630185627
OS: Ubuntu 14.04 x32

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

Fixed in Firefox 31 which just landed.

Changed in hundredpapercuts:
status: Triaged → Fix Released
Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
In , Z-dev (z-dev) wrote :

Landed in Xubuntu 14.04, thanks !

Now if you guys would like to have a look at the related painful bug 397700, so that Firefox finally wholly enters the 21st century on Linux... :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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