Register protocol: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
Line 4: Line 4:
    
    
==Windows==
==Windows==
On Windows, registration is done by the operating system (OS).  For example, when you set a web browser as the [[default browser]], the OS will register the ''http'',  ''https'' and ''ftp'' protocols and associate them with that web browser.  When you open a URL link in another application such as Thunderbird,  it will launch your default browser.  Similarly, when you set a [[default mail client]], the OS registers the ''mailto'' protocol so that ''mailto'' links in a browser window will open your default mail program to compose the message.   
On Windows, registration is done by the operating system (OS).  For example, when you set a web browser as the [[default browser]], the OS will register the ''http'',  ''https'' and ''ftp'' protocols and associate them with that web browser.  When you open an ''http'' ''https'' or ''ftp'' link in another application such as a mail program, or from an Internet Shortcut,  it will launch your default browser.  Similarly, when you set a [[default mail client]], the OS registers the ''mailto'' protocol so that ''mailto'' links in a browser window will open your default mail program to compose the message.   


Note: Mozilla Suite and SeaMonkey integrate handling of mail and browser URLs, regardless of the default mail and browser applications. Web URL links  (e.g.,  http, https and ftp) that are opened from SeaMonkey Mail will open a SeaMonkey browser window and mailto links in a SeaMonkey browser window will be handled by SeaMonkey Mail.     
Note: Mozilla Suite and SeaMonkey integrate handling of mail and browser URLs, regardless of the default mail and browser applications. Web URL links  (e.g.,  http, https and ftp) that are opened from SeaMonkey Mail will open a SeaMonkey browser window and mailto links in a SeaMonkey browser window will be handled by SeaMonkey Mail.     

Revision as of 16:26, 8 March 2008

A protocol is a method that is used to send, receive, and handle information over a connection. Common protocols viewed from the browser include http, https, ftp, and mailto. In order for you to view information sent over a specific protocol, it must be registered. If you enter a URL for an unknown protocol (foo) in the Location Bar, you will receive a message such as, Firefox doesn't know how to open this address, because the protocol (foo) isn't associated with any program or, in Mozilla Suite/SeaMonkey, foo not a registered protocol.

Once registered, the protocol can then be handled by the program you specify, such as your browser or a third party viewer. This means that a hyperlink ( e.g. foo://fred) can use the handler for protocol foo to open the file named fred.

Windows

On Windows, registration is done by the operating system (OS). For example, when you set a web browser as the default browser, the OS will register the http, https and ftp protocols and associate them with that web browser. When you open an http https or ftp link in another application such as a mail program, or from an Internet Shortcut, it will launch your default browser. Similarly, when you set a default mail client, the OS registers the mailto protocol so that mailto links in a browser window will open your default mail program to compose the message.

Note: Mozilla Suite and SeaMonkey integrate handling of mail and browser URLs, regardless of the default mail and browser applications. Web URL links (e.g., http, https and ftp) that are opened from SeaMonkey Mail will open a SeaMonkey browser window and mailto links in a SeaMonkey browser window will be handled by SeaMonkey Mail.

Other protocols can be registered to associate URLs with external applications. For example, you can set RealPlayer as the registered protocol handler for RTSP (Real Time Streaming Protocol) using RealPlayer's advanced preference settings for content Media Types. When you next open a URL for the protocol, Firefox or Mozilla Suite/SeaMonkey will ask you to confirm the external protocol request before it will launch the application [1] [2].

It is also possible to register a protocol by creating a .reg file such as the following, and placing this in the file:

REGEDIT4

[HKEY_CLASSES_ROOT\foo]
@="URL:foo Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\foo\shell]

[HKEY_CLASSES_ROOT\foo\shell\open]

[HKEY_CLASSES_ROOT\foo\shell\open\command]
@="\"C:\\Program Files\\Application\\program.exe\" \"%1\"" 

Replace foo with the protocol you're specifying and C:\\Program Files\\Application\\program.exe with the program you want to run. Note that backslashes must be doubled and the additional slashes and quotes before the path must not be removed. Save the file, then double-click it to insert into the Windows registry. See Registering an Application to a URL Protocol for additional information.

Linux and Mac

  • Type about:config into the address bar and press Enter.
  • Right-click -> New -> Boolean -> Name: network.protocol-handler.external.foo -> Value -> true (Replacing foo with the protocol you're specifying)
  • Right-click -> New -> String -> Name: network.protocol-handler.app.foo -> Value -> /path/to/app (Replacing foo with the protocol you're specifying and /path/to/app with the path to the application you want to run.
  • Ensure network.protocol-handler.expose-all is set to true.

Troubleshooting

  • (Linux and Mac) If the path or name is incorrect when setting the network.protocol-handler.app.(protocol) preference , Firefox will display an error saying "protocol (foo) isn't associated with any program". (bug 312953)
  • If you receive a message in Firefox that the mailto protocol is not associated with any program, reset your default mail client. [3]
  • Certain unsafe protocols are ignored by default (bug 173010).

See also


External links

The protocol is not associated with any program (Firefox Support)