MozillaZine

Talk:Register protocol

From MozillaZine Knowledge Base

Does network.protocol-handler.app.foo do anything on Windows? I tried to change it, but it keeps using the program I defined in the registry.--Np 19:52, 13 October 2006 (UTC)

I don't know but I tested it in Windows XP in Firefox 2.0 by adding network.protocol-handler.app.mailto with a value of: C:\Program Files\Mozilla Thunderbird\thunderbird.exe and my default mail handler (OE) still opened, not Thunderbird. I looked at Default mail client and network.protocol-handler.app.mailto is only listed under Linux. Google search came up with http://www.mozilla.org/projects/thunderbird/linuxurls.html and http://weblogs.mozillazine.org/gerv/archives/007221.html .... which only mention "network.protocol-handler.app." in relation to Linux. Alice Wyman 21:27, 13 October 2006 (UTC)

The email account we use to let users request a kb account recently got email about this page:

"The missing piece is that the user may need to use regedit to delete any existing HKR\foo key before inserting the one created here.

M$ recently hijacked the FTP protocol handler, so that clicking an FTP link in a Tbird message started opening an Internet Exploder window rather than opening the link in Firefox (previous behavior). After beating my head against assorted walls (including a fruitless change to the network.protocol-handler.app.ftp setting in Tbird), I found this article and inserted the key. It didn't work, although the shell open action was indeed correctly set, because M$ had set another property under this key (can't recall the name) that invoked the IE dll. There were also a couple of additional properties whose function was unclear to me. So I deleted the entire key, added in the one created from this page, and it worked."

I no longer run Windows so I couldn't verify it. Tanstaafl 19:00, 28 February 2008 (UTC)

Very odd. Firefox is my default browser and is the registered application in Folder Options File Types for the FTP protocol. I drafted a Thunderbird mail message with an ftp link to ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/latest-trunk/ When the link opened, it looked to be a Windows Explorer window, showing folders and files, except that it was titled "Microsoft Internet Explorer":
Image:Tbird FTP link.PNG
However, iexplore.exe was not in the Windows Task Manager. When I opened the link within Internet Explorer 7, a normal IE7 browser window opened. Within the page, it said, "To view this FTP site in Windows Explorer, click Page, and then click Open FTP Site in Windows Explorer." I used that option (in the View menu, actually) and it opened the same Windows Explorer window as before. Here is an export of my HKEY_CLASSES_ROOT\ftp registry key on Windows XP:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ftp] 
@="URL:File Transfer Protocol" 
"EditFlags"=dword:00000002 
"ShellFolder"="{63da6ec0-2e98-11cf-8d82-444553540000}" 
"Source Filter"="{E436EBB6-524F-11CE-9F53-0020AF0BA770}" 
"FriendlyTypeName"="@ieframe.dll,-905" 
"URL Protocol"="" 
"BrowserFlags"=dword:00000008 

[HKEY_CLASSES_ROOT\ftp\DefaultIcon] 
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1" 

[HKEY_CLASSES_ROOT\ftp\shell] 
@="open"

[HKEY_CLASSES_ROOT\ftp\shell\open]

[HKEY_CLASSES_ROOT\ftp\shell\open\command] 
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -requestPending -osint -url \"%1\""

[HKEY_CLASSES_ROOT\ftp\shell\open\ddeexec] 
@="\"%1\",,0,0,,,,"

[HKEY_CLASSES_ROOT\ftp\shell\open\ddeexec\Application] 
@="Firefox"

[HKEY_CLASSES_ROOT\ftp\shell\open\ddeexec\Topic] 
@="WWW_OpenURL"
I reset Firefox as the default browser in Control Panel -> "Set Program Access and Defaults" and also used the instructions in Windows error opening Internet shortcut or local HTML file - Firefox to remove the DDE entries in the URL: File Transfer Protocol entry in Folder Options File Types, (which removed the three ddeexec keys) and tried again, but it made no difference.
So, it looks like Microsoft DID hijack the FTP protocol on my system as well! I really don't care for myself and don't plan on mucking around with it and I think that this may be more related to how Firefox registers ftp protocols on Windows when it is the default browser {EDIT: but it's only an issue for me with Thunderbird ftp links... see below. Alice 00:47, 1 March 2008 (UTC)} Personally, I think we should remove the entire Windows registry instructions and just leave the link to Registering an Application to a URL Protocol for additional information. Alice 22:29, 28 February 2008 (UTC)
Let me see if I understand this correctly. You're saying you couldn't get it to work either by following the suggestion to remove the existing key and then create one, or by just following the instructions in the MSDN link, and you're proposing we wash our hands of it by removing the broken instructions and pointing them to a MSDN article that you know won't solve the problem? Please tell me that I misunderstood what you're suggesting.
I'd like to add some more information, after doing more testing. The problem is with Thunderbird, not Firefox, based on these tests:
  • I included a link to ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/latest-trunk in an Outlook Express mail message and clicking the link in the OE message opened Firefox just fine. Outlook Express is my default mail program, by the way, not Thunderbird.
  • I entered the same ftp link in the Windows Run box and that also opened just fine in Firefox.
  • A desktop shortcut to the same ftp url also works just fine, opening Firefox
So, the only instance where Firefox doesn't open was with a Thunderbird ftp link. Could the "problem" (and it's not really a problem for me, anyway) possibly be because OE is my default mail program, not Thunderbird? I mainly use SeaMonkey mail where an external protocol handler isn't an issue since SeaMonkey just opens ftp mail links in SeaMonkey. Alice 00:47, 1 March 2008 (UTC)
Does either the protozilla add-on or the mozex add-on work with Windows? klade has a modified version of the mozex add-on but that looks like it might be superfluous now that the original author updated his add-on for firefox 2. Tanstaafl 19:26, 29 February 2008 (UTC)
The protozilla extension looks like a possibility for registering protocols and the link you gave says Win32 (Windows 32-bit) but with what Mozilla application? It talks about Mozilla and Netscape 6! The mozex faq page http://mozex.mozdev.org/faq.html has information for using it on Windows but mozex seems to be more about setting up external apps for existing protocols and this article is supposed to be about registering new protocols. Alice 00:47, 1 March 2008 (UTC)
This article also briefly mentions troubleshooting the "protocol (foo) isn't associated with any program" error which is another reason people will want to look at this article. I think that, if anything, that section should be expanded. For example, RTSP (Real Time Streaming Protocol) links may result in the error. The solution for Windows users is to register the protocol from within the Real Player program... I happened to have the following posts of mine bookmarked. Alice 00:47, 1 March 2008 (UTC)
http://forums.mozillazine.org/viewtopic.php?p=2031121#2031121 RTSP Not working
OK, I did some research and found a test link from the page source at http://www.c-span.org

rtsp://video.c-span.org/15days/e011906_children.rm

This didn't work for me in IE (got "page cannot be displayed) and in Firefox I got a similar error as you, indicating that RTSP was not a registered protocol. I looked in Windows Folder Options, Filetypes and I had no RTSP or Real Time Streaming Protocol entry listed.

This is what I did to get it working:
I opened Real Player preferences and changed the media types (content) to include Real-Time Streaming Protocol (RTSP) in addition to SDP and SMIL. Afterwards, I had an entry for [none] "Real-Time Streaming Protocol" appear in my Windows Folder Options > Filetypes where it was missing before.
Here are the instructions for Real Player 10.5 that I used, from http://www.c-span.org/watch/help.asp
1. Click on the Start menu button on the Windows' Taskbar.
2. Go to Programs, then Real, followed by RealPlayer.
3. Once the player launches, click on Tools.
4. Select Preferences.
5. Select the Content category.
6. Under Media Types, click the Advanced button on the right.
7. Scroll down on the list of media types, to the listing: Real-Time Streaming Protocol (RTSP).
8. Click on the check box to enable the RTSP media type for your video player.

After doing the above, you should get a prompt to launch an external application in Firefox 1.5 when clicking "rtsp://" links and it will launch Real Player. "rtsp://" links should also work in IE

Alice 00:47, 1 March 2008 (UTC)
You're saying you couldn't get it to work either by following the suggestion to remove the existing key No, I didn't say that. I said that I'm not going to muck about deleting the HKEY_CLASSES_ROOT\ftp key just to test out how to replace one protocol handler with another for an exiting protocol on Windows. This article, as I understand it, isn't supposed to cover that. Any instructions for changing an existing protocol handler to Firefox or another Mozilla application should be included in the Default browser or Default mail client articles. In fact, I don't think this article should include detailed instructions for adding a new protocol on Windows at all... it should just point people to the Microsoft article (or another Windows site) since the operating system handles that on Windows. On Linux and Mac OS, the network.protocol-handler.app.(protocol) preference lets you add a protocol handler from within your Mozilla application and that should be the main point of this article. Alice 22:06, 29 February 2008 (UTC)
I don't agree with your suggestion that we should change the scope of this article. Why don't you like the idea of mentioning the two add-ons plus pointing them to the MSDN article (for Windows)? That gets us out of the business of describing what registry keys to muck with. Tanstaafl 22:48, 29 February 2008 (UTC)
What do you see as the scope of this article? See my above comments on the two extensions. Alice 00:55, 1 March 2008 (UTC)
I'm the e-mail source quoted above. (I'd hoped to get away with not having to register a user id and not having to get dragged into editing anything. No such luck.) Before getting into the should we/shouldn't we debate, let me mention that I just tested this on a Vista box I had previously not touched. Prior to hacking, my HRCR\ftp key looked like the one quoted above. I created and ran the .reg file described in this article, and it merged in the new info without solving the problem. I don't have T-bird on that box, but entering an FTP URL in Windows Explorer opened the site in Explorer, not Firefox. A little tinkering suggests that deleting the ShellFolder value is the trick; after that, entering an FTP URL in Explorer opened it in Firefox. As to where (if anywhere to put this), it seems to me that if this article is going to include a section on doing Windows protocols, at minimum there should be a warning that it may not work due to prior info in the key. I looked at the Default browser and Default mail client articles. For the specific issue of the FTP handler, the latter does not seem relevant and the former is primarily about picking the HTTP handler (web browser). I suppose someone might try to make the web browser instructions work for setting the FTP client -- but they don't. The program access defaults settings (at least on my XP Home box) do not cover FTP, and the folder options route is the first thing I tried -- to no avail. Maybe a compromise is to create a new page discussing why those things may not work and link that from this article? If hacking the reg key ends up discussed, we should also point out that (a) you should save the old key first just in case and (b) this will change the FTP handler not just in T-bird but pretty much across the board. --Paul 22:46, 2 March 2008 (UTC)
I don't have T-bird on that box, but entering an FTP URL in Windows Explorer opened the site in Explorer, not Firefox. Paul, if by "Explorer" you mean "Windows Explorer", isn't that what it is supposed to do? A little tinkering suggests that deleting the ShellFolder value is the trick; after that, entering an FTP URL in Explorer opened it in Firefox. Entering an FTP URL in a Windows Explorer window opened it in Firefox? I wouldn't want that to happen, if Windows Explorer is able to handle the FTP URL. If I enter an FTP URL in any program that is able to handle that protocol internally, then I would think it should open in that program. Image:WinExplorerFTP-link.png
On my Windows XP system ( with IE7), entering ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/nightly/latest-trunk/ in a Windows Explorer window's Address bar, the url opens in the same Windows Explorer window, showing files and folders.
Image:RunFTPurl.png
If I go to Internet Options -> Advanced and uncheck "FTP Folder view (outside of Internet Explorer)" then I get an "FTP Folder Error" dialog. When you enter an FTP URL in the Windows RUN dialog THEN your default browser is supposed to open (unless of course you have another application set as your FTP handler - see this bug report comment) and that does open Firefox for me. Alice 22:03, 3 March 2008 (UTC)
When I click the ftp link from within an Outlook Express mail message, Firefox also opens. If I click that same ftp link within a Thunderbird mail message, a Windows Explorer window opens, either in the FTP Folder view (as in the first image I posted) or as links, shown here,
Image:FTPlinks.png
depending on whether "FTP Folder view (outside of Internet Explorer)" in Internet Options is checked or not. That is not supposed to happen. If Firefox is your default browser it is also supposed to open when you click an FTP URL link within a Thunderbird mail message, although some users report it doesn't, including Jay Garcia here. Related bug reports, maybe?
If you want to include a registry hack for setting URL FTP Protocol to open in Firefox from Thunderbird, if that isn't happening, then, if anywhere, I think it belongs in a Thunderbird "Issues" article, maybe, if the only problem is in Thunderbird, not here. I'm really really not in favor of recommending registry hacks since incorrect deletions of registry keys can damage your system. The linked forum posts in Talk:Addresses entered in IE open in Firefox show the catastrophic effects that can happen when inexperienced users incorrectly follow instructions to edit the registry. Alice 22:03, 3 March 2008 (UTC)