Launch web browser keyboard shortcut loads directory listing for home folder

Bug #196493 reported by Grey Nicholson
6
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Unknown
Ubuntu
Won't Fix
Undecided
Unassigned

Bug Description

When pressing the keyboard shortcut set for “Launch web browser” (System → Preferences → Keyboard Shortcuts), the directory listing for the user's home folder is loaded into the browser (instead of the home page or a blank tab or similar).

Revision history for this message
InsClusoe (insclusoe) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately we can't fix it, because your description didn't include enough information. You may find it helpful to read "How to report bugs effectively" [WWW] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem.

We have instructions on debugging some types of problems. [WWW] http://wiki.ubuntu.com/DebuggingProcedures

At a minimum, we need:
1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).
Thanks!

Revision history for this message
InsClusoe (insclusoe) wrote :

1. Which browser are you using?
2. What version?
3. Examine the preferences settings of your browser. What is the home page of your browser set to?

Revision history for this message
In , Grey Nicholson (greytheearthling) wrote :

(Spotted on Ubuntu Hardy (8.04 development branch) using the latest trunk nightly from Mozilla.)

When Firefox sets itself as the default browser on Gnome, the command it uses to invoke itself is:
/path/to/firefox "%s"

Then, when Firefox is invoked from the keyboard shortcut (set in Gnome's System → Preferences → Keyboard Shortcuts), Firefox loads the user's home folder as a directory listing (i.e. it loads file:///home/example/ ).

Instead, Firefox should open a new window, as if it had been invoked from the Applications menu or a launcher. This can be achieved by changing the command used to invoke Firefox from the above to:
/path/to/firefox %s
i.e. by removing the quotation marks (users can do this in System → Preferences → Preferred Applications → Internet).

The in-built version of Firefox in Ubuntu invokes itself using:
firefox %s
so removing the quotes shouldn't have any unforeseen repercussions.

So: Firefox should register itself as the default browser using:
/path/to/firefox %s
instead of
/path/to/firefox "%s"

(I suppose other distros will also set this command themselves for the Firefoxen they distribute, which is why I've set this bug's severity to minor. I also reported this to Launchpad; detailed steps to reproduce are at https://bugs.launchpad.net/bugs/196493 )

Revision history for this message
Grey Nicholson (greytheearthling) wrote :

I can reproduce this only with Mozilla's trunk Firefox (Minefield, I'm using the latest nightly)—and not with the Firefox packaged in Ubuntu.

I do recall seeing this bug quite a while ago (circa Edgy or Feisty) but I may have been using a Firefox build from Mozilla then as well.

My homepage is about:blank, and Firefox is set to show a blank page on startup.

Proper steps to reproduce:

1. Download, extract and run a Mozilla build of Firefox ( e.g. http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ )
2. When prompted, make it the default browser (or do so from Edit → Preferences → Advanced → General); in my case, this sets the Web Browser command in System → Preferences → Preferred Applications → Internet to “/home/greg/firefox/firefox "%s"”
3. System → Preferences → Keyboard Shortcuts: assign a keyboard shortcut to “Launch web browser”; I have a specific “www” button, but I can also reproduce this using a “normal” key combination such as Ctrl+Alt+F
4. With Firefox closed, press the keyboard shortcut

Actual result: Firefox opens with the home folder's directory listing loaded (in my case, file:///home/greg/ )
Expected result: Firefox opens and shows whatever it's configured to show in Edit → Preferences → Main → Startup

5. With Firefox still open, press the keyboard shortcut again

Actual result: Firefox loads the home folder's directory listing into a new tab
Expected result: Firefox either opens a new blank tab, or opens a new window as if invoked from the Applications menu

Steps to then reproduce the expected behaviour:

6. System → Preferences → Preferred Applications → Internet: set Web Browser to (the in-built) Firefox; this sets the Web Browser command to “firefox %s” (it may be noteworthy that quotation marks are absent here, but not above)
7. With Firefox (both versions) closed, press the keyboard shortcut

Actual result: Firefox (in-built) opens, showing the “Welcome to Ubuntu Hardy Heron!” first-run page ( file:///usr/share/ubuntu-artwork/home/index.html ), as if Firefox had been invoked from the Applications menu
This is also the expected result

8. With Firefox (in-built) still open, press the keyboard shortcut again

Actual result: A new Firefox window opens, as if Firefox had been invoked from the Applications menu
This is the expected result

9. Close Firefox; press the keyboard shortcut yet again

Actual result: Firefox opens showing whatever is configured in Edit → Preferences → Main → Startup
This is the expected result

It seems that the problem *is* the pair of quotes I mentioned in step 6: changing “/home/greg/firefox/firefox "%s"” to “/home/greg/firefox/firefox %s” in System → Preferences → Preferred Applications → Internet after step 2 fixes this.

That means that this is a problem in the way that Mozilla's builds of Firefox set themselves as the default browser. (And probably not a problem in Ubuntu, though I still find it somewhat surprising that adding quotes would cause the home folder to be loaded.)

So, I've reported this to Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=420408

Thanks for forcing me to investigate this properly :)

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
Philip Muškovac (yofel) wrote :

Thank you for taking the time to report this bug and trying to help make Ubuntu better. However, it seems that you are not using a software package provided by the official Ubuntu repositories. Because of this the Ubuntu project can not support or fix your particular bug. Thanks for reporting this bug upstream and please report any other bugs you may find!

Changed in ubuntu:
status: Incomplete → Won't Fix
Changed in firefox:
importance: Unknown → Low
Revision history for this message
In , Kcarchana77 (kcarchana77) wrote :

I am interested to work on this bug and I would I like to know more details about this bug. I would also like to know where I should get started.

Revision history for this message
In , X3ask (x3ask) wrote :

olsolete and resolved

if set as default from preferences, firefox (from mozilla) creates ~/.local/share/applications/userapp-Firefox-RANDOM.desktop with Exec=/path/to/firefox %u

Revision history for this message
In , Vlad-lucaci (vlad-lucaci) wrote :

Hello,

This issue still occurs in 76.0b8 with Ubuntu 18.04 . Upon clicking the "Make default..." button , the browser is not saved as default and the following error is triggered inside the browser console:

`[Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIShellService.setDefaultBrowser]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: chrome://browser/content/preferences/in-content/main.js :: setDefaultBrowser :: line 1305" data: no] main.js:1305:18
    setDefaultBrowser chrome://browser/content/preferences/in-content/main.js:1305
    setDefaultBrowser self-hosted:844`

Changed in firefox:
importance: Low → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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