Launchpad has imported 6 comments from the remote bug at
https://bugzilla.mozilla.org/show_bug.cgi?id=947868.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2013-12-09T12:19:01+00:00 Mathieu Comandon 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.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1197559/comments/8

------------------------------------------------------------------------
On 2013-12-09T14:37:13+00:00 Bzbarsky wrote:

Mike?

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1197559/comments/9

------------------------------------------------------------------------
On 2014-02-24T15:38:06+00:00 Ritesh 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 .

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1197559/comments/10

------------------------------------------------------------------------
On 2014-02-24T16:22:16+00:00 Josh Matthews 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.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1197559/comments/11

------------------------------------------------------------------------
On 2014-02-24T20:17:08+00:00 Ritesh 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);

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1197559/comments/12

------------------------------------------------------------------------
On 2014-02-25T04:07:11+00:00 Ritesh 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

Reply at:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1197559/comments/13


** Changed in: firefox
       Status: Unknown => New

** Changed in: firefox
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1197559

Title:
  Regression: Firefox forgot how to open apt urls

To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1197559/+subscriptions

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

Reply via email to