Register protocol: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
m (→‎Windows: Changing the word "replacing" to match the right tense.)
(added SeaMonkey "not a registered protocol: screenshot, examples of browser, mail and RealPlayer programs registering a protocol.)
Line 1: Line 1:
A [http://en.wikipedia.org/wiki/Protocol_%28computing%29 protocol] is a method that is used to send, receive, and handle information over a connection. Common protocols viewed from the browser include <i>http</i>, <i>ftp</i>, and <i>mailto</i>. In order for you to view information sent over a specific protocol, it must be registered. Once registered, the protocol can then be handled by the program you specify, such as your browser or a 3rd party viewer. This means that a hyperlink ( e.g. foo://fred ) can use the handler for protocol <i>foo</i> to open the file named <i>fred</i>. If a protocol is not registered, you will receive the message "protocol (foo) isn't associated with any program".
A [http://en.wikipedia.org/wiki/Protocol_%28computing%29 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.   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''. If a protocol is not registered, you will receive the message, ''protocol (foo) isn't associated with any program'' (Firefox) or ''foo is not a registered protocol'' (Mozilla Suite/SeaMonkey). {{Right-pic|SMnotaRegisteredProtocol.PNG}}


==Windows==
==Windows==
On Windows, registration is done by the OS. To change the OS's settings, create a .reg file, and place this in the file:
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 so that they are associated with that web browser and when you set a mail program as the [[default mail client]], the OS will register the ''mailto'' protocol so that it uses that mail program.  As another example, you can set [[RealPlayer]] as the registered protocol handler for RTSP ([http://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol Real Time Streaming Protocol]) using RealPlayer's advanced preference settings for Media Types [http://forums.mozillazine.org/viewtopic.php?p=2031121#2031121]). 
 
It is also possible to register a protocol by creating a .reg file such as the following, and placing this in the file:
<pre>
<pre>
REGEDIT4
REGEDIT4
Line 17: Line 19:
@="\"C:\\Program Files\\Application\\program.exe\" \"%1\""  
@="\"C:\\Program Files\\Application\\program.exe\" \"%1\""  
</pre>
</pre>
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.
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 [http://msdn2.microsoft.com/en-us/library/aa767914.aspx Registering an Application to a URL Protocol] for additional information.
 
See [http://msdn2.microsoft.com/en-us/library/aa767914.aspx Registering an Application to a URL Protocol] for additional information.


==Linux and Mac==
==Linux and Mac==
Line 28: Line 28:


==Troubleshooting==
==Troubleshooting==
* If the path or name is incorrect, the browser will display an error saying "protocol (foo) isn't associated with any program". (See [https://bugzilla.mozilla.org/show_bug.cgi?id=312953 bug 312953]).<br/>
* If the path or name is incorrect, Firefox will display an error saying "protocol (foo) isn't associated with any program". (See [https://bugzilla.mozilla.org/show_bug.cgi?id=312953 bug 312953]).<br/>
[[Image:Protocol is not associated.PNG]]


==See also==
==See also==
*[[Network.protocol-handler.app.(protocol)]]
*[[network.protocol-handler.app.(protocol)]]
*[[network.protocol-handler.external.(protocol)]]





Revision as of 05:00, 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. 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. If a protocol is not registered, you will receive the message, protocol (foo) isn't associated with any program (Firefox) or foo is not a registered protocol (Mozilla Suite/SeaMonkey).

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 so that they are associated with that web browser and when you set a mail program as the default mail client, the OS will register the mailto protocol so that it uses that mail program. As another example, you can set RealPlayer as the registered protocol handler for RTSP (Real Time Streaming Protocol) using RealPlayer's advanced preference settings for Media Types [1]).

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

  • If the path or name is incorrect, Firefox will display an error saying "protocol (foo) isn't associated with any program". (See bug 312953).

See also