Open a local program in a Chrome browser Web page via private protocol

Source: Internet
Author: User

Recently, there is a need for party a: two sets of systems, a set of chrome-based development, a set of IE-based development, want to add a link in chrome, and then into the IE developed system. That is, you want to create a link in chrome to jump to the IE browser to specify the page, but also to achieve jump animation effect. This requires that we first solve the problem of jumping from chrome to ie.

Problem analysis: Jump from chrome to IE, directly in the form of HTTP link is not possible to jump to IE, only through a separate development of local programs to open IE, the question is how to let Chrome open the program. There is a way to do this: by registering a private protocol, the user clicks on the link directly using the private protocol to invoke the local program.

Practice: First, write a small program, put it under d://; next, write a private protocol registry, open it with Notepad, and edit the following:

Windows Registry Editor Version 5.00



[HKEY_CLASSES_ROOT\F1]
@= "Url:f1 Protocol Handler"
"URL Protocol" = ""


[Hkey_classes_root\f1\shell]


[Hkey_classes_root\f1\shell\open]


[Hkey_classes_root\f1\shell\open\command]
@= "D:\\winmain.exe \"%1\ ""

Then save as F1.reg, the registry is complete, where the D:\\winmain.exe is the path of the applet, double-click the Fa.reg, OK to write the protocol to the Registry, only need to call the F1 protocol in Chrome. Practice, open chrome, save a new bookmark, and then edit the bookmark as shown in:


Once saved, click the bookmark to open the program.

Of course, the icon is not particularly nice and we can modify it. To do this: Save all chrome bookmarks as an HTML file, my HTML bookmark file


The href followed by the protocol and address, Add_data followed by the time stamp of creation time, icon followed by the bookmark icon address after the Base64 conversion results. So want to change the icon, just need to find the corresponding F1 behind the icon, through the Base64 to convert the image address, and then copy in. In chrome, by importing bookmarks, import the modified bookmarks into the bookmark icon will change to what you want, I do not give pictures here, I would like to try a friend can get it.

In the next chapter I will implement the effect of this applet: smooth jump, cut-out animation, please look forward to!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.