Internet Explorer (Microsoft) Extension Development

Source: Internet
Author: User

Recently, the development of browser plug-ins is a bit addictive. I first developed a FF (Firefox) browser plug-in, and later I developed a Google browser plug-in, this time, we will try to develop a rough plug-in for IE browser to implement ordering with one click and cancel ordering with one click.
Everything is ready, but this time we have taken some detours. I only mentioned Internet internet Internet Plug-in development without mentioning the concepts of COM and BHO. For this reason, I also downloaded vs2010, installed Platform SDK, and downloaded n examples from codeproject for research, although I have not used vs2010 for several years and have never been writing COM, I am a little bit confused. I can basically understand it, understand the principles of BHO, and understand some com things, there are also some gains. However, the more I see it, the more I feel that I don't need to be so troublesome, And I don't need BHO to process various message statuses. I only need to add a button on IE, click this button, call js I wrote to trigger an operation, and give a prompt. It's okay to take a detour. It may be used next time.

Now you need to add a button to change the policy to trigger the operation. Find help on Internet Explorer development and find an article about how to add menu items. Read carefully and understand that the buttons on IE are completed by adding the registry key, and two registry keys are generated.

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ internetexplorer \ extensions \ {dimensions}] "CLSID" = "{dimensions}" "menutext" = "I want to order meals" "menucustomize" = "I want ordering "" menustatusbar "=" I want to order "" clsidextension "=" "[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ internetexplorer \ extensions \ {BA6C7C63-9EFC-4DA1-B5D9-666A624F4831}]" CLSID "=" {detail} "" menutext "=" cancel meal ordering "" menucustomize "=" cancel meal ordering "" menustatusbar "=" cancel meal ordering "" clsidextension "= ""

Import the registry key, restart IE, and see the two options in the tool. I want to order and cancel the order. Only clicking these two menu items does not respond, because we did not add a response event to these two menu items. Simply add exec to the registry key. If we want to use the previous JS, We need to write a page to execute this Js. For example, we need to write the following code:

<HTML> 

If we write exec like this

"Exec"="file:///D:/Program%20Files/dingcan/dingcan.html"

Internet Explorer is a new window, and the user experience is poor. In this case, we use a little skill to modify .html to the. HTA suffix, and the entire event is cleared. After this setting, click the button, it looks a little big,

Add the following code in HTML to set the window size,

<scriptlanguage="javascript">window.resizeTo(200,100)</script>

This is the case. It's perfect.

HTA content supplement:The full name of HTA is htmlapplication (the full name of HTML is Hyper Text Markup Language), and HTA is an HTML application. HTA files do not need to be executed in the browser. Windows can directly execute this program. For more details, see HTML applications:
Http://msdn.microsoft.com/en-us/library/ms536471%28v=VS.85%29.aspx

The implementation of the IE Plug-in is very cumbersome, but he has implemented the functions I want. These extensions are all superficial and have no advanced technical knowledge. They just hope to help you and eliminate the unconfidence in browser extension.

References
Add menu items

Http://msdn.microsoft.com/en-us/library/aa753591 (V = vs.85). aspx

Internet Explorer Development

Http://msdn.microsoft.com/en-us/library/bb188743.aspx

Related Article

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.