-   Linux - Software (
-   -   What is "firefox %u"? (

Mr. Alex 07-15-2010 10:52 AM

What is "firefox %u"?
Whay do I have a link to start Firefox with "%u"? What is "%u" and where to read about this kind of parameters?

acid_kewpie 07-15-2010 10:56 AM

it's the url you have clicked on

trickykid 07-15-2010 10:56 AM

These usually aren't pertaining to firefox itself but the desktop or window manager you are using. To my knowledge, the %u stands for single URL.

Kenhelm 07-15-2010 02:17 PM

%u is a field code.

Mr. Alex 07-16-2010 05:05 AM

Thanks but what is "single URL" here in Firefox? Whether I start it with "%u" or not - no difference.

acid_kewpie 07-16-2010 05:24 AM

it's for when you click on something that your DE, e.g. GNOME thinks it should open in a browser.

MrCode 07-16-2010 05:42 AM

That "%u" gets replaced by whatever URL (or file path) you clicked on in the command that gets executed. Like acid_kewpie said above, it's for your DE.

GrapefruiTgirl 07-16-2010 05:43 AM

As I understand this, it's mainly for desktop managers (KDE, XFCE, GNOME) to interface with your various applications, but not so much for you (the user) to use as if it were a command line:

The idea, I believe, is for when you are (let's say for example) reading a PDF file with some PDF reader, and the PDF contains a URL (a web address) and you want to open the URL in your browser. Your DM knows what browser you like and how to start it up, while the PDF reader itself does not necessarily know how to start a browser, nor what browser you like, nor necessarily what to with a URL at all. So, it passes the request (the URL) to the desktop manager.

In the case of %u (a single URL) you have your desktop manager configured such that when a URL is clicked from whatever application (PDF reader passes a URL to the DM) your DM knows that when it gets a URL from an application, it should execute "firefox %u", which results in the DM expanding the %u with the single argument it's given (the URL) to create a command-line like `exec firefox`, and fire up the browser to open that URL.

So, further example, what about %U (a capital U)? This indicates a list of URL's; so if the PDF reader (or whatever application) sends a list of URLs to the desktop manager to deal with, the desktop manager knows (because you have it configured) it should exec the command "firefox %U", and so expands the %U into "", resulting in an exec-command-line like "exec firefox" and your firefox fires up with 3 tabs (or 3 windows) each with one of the URLs.

As implied above (and indicated by the other posters), this isn't useful for you to start firefox yourself from a commandline with a % code, because you know you would simply need to type "firefox" to achieve the desired result.

Mr. Alex 07-16-2010 08:38 AM

Thanks to everybody. :)

All times are GMT -5. The time now is 06:46 AM.