Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use the UX and Nightly builds of Firefox from FTP as my default browsers, but they don't open external links (just a new blank window).

So for example in a help file that is expected to open with whatever the "default" browser is instead Firefox opens just a blank window instead of the actual page when I click on an external link?

How can I fix this?

I've got a custom desktop file to launch the browser in ~/.local/share/applications, and if it makes a difference I'll post its contents here (let me know in the comments).

Here are the contents of the .desktop file:

[Desktop Entry]
Type=Application
Version=1.0
Hidden=false
Terminal=false
Icon=/usr/share/icons/fs-icons/apps/scalable/firefox-original.png
Name=Firefox Nightly FTP Build
Comment=Firefox Nightly FTP Build
Exec=/home/rolandixor/bin/firefoxui/firefox
Path=/home/rolandixor/bin/firefox
share|improve this question
    
What do you mean by "ftp build" or "from FTP"? Why should the source matter? And what is meant by "external links"? Are only local pages (like file:///home/vasa1/Documents/MyLinks.html) opening? –  user25656 Jun 12 '13 at 17:00
2  
@vasa1 ftp build means from Mozilla's FTP server (Where they make official releases). External links mean links sent to Firefox from other applications. –  RolandiXor Jun 12 '13 at 17:11
    
Would an example of an external link be a link (url) in a help file that is expected to open with whatever the "default" browser? So the ftp Firefox opens just a blank window instead of the actual page when you click on an external link? –  user25656 Jun 15 '13 at 8:29
    
@vasa1 exactly. –  RolandiXor Jun 15 '13 at 19:11
2  
Please post your .desktop file, in particular the "Exec" line; does it have %u at the end? –  David Edwards Jun 19 '13 at 20:10
show 5 more comments

1 Answer

up vote 6 down vote accepted
+200

The .desktop file is the key here because it not only configures how an application is opened from the Unity launcher (see Unity Launchers And Desktop Files) but also how it is used to open a specific file when called from the file manager, etc.

In order for the latter to work correctly, the .desktop file needs to specify how to pass arguments to the command being called. This is done using field codes in the Exec line which will be substituted with real values when the command is called.

In your case, your original .desktop file did not specify how to tell Firefox which URL to open, so Firefox was called with no arguments and just opened on your default home page.

The field code to insert the URL in the command line is %u so adding this as an argument to the firefox command in the Exec line of the .desktop file solves the problem. For example, the standard firefox.desktop file uses the line:

Exec=firefox %u

For reference, the standard file can be found at /usr/share/applications/firefox.desktop if you have installed from a package; it is generated by firefox.desktop.in as found in the firefox repository on Launchpad.

For further information about Exec field codes in .desktop files, the specification is available on the freedesktop.org website.

share|improve this answer
    
Wouldn't it be better to use %U instead of %u? –  Seth Jun 20 '13 at 15:18
    
Probably; firefox does support taking a list of URLs. The standard package uses %u; I don't know why. –  David Edwards Jun 20 '13 at 15:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.