Home > Backend Development > C++ > How to Develop Internet Explorer Extensions for IE8 and IE11?

How to Develop Internet Explorer Extensions for IE8 and IE11?

Patricia Arquette
Release: 2025-01-23 01:46:10
Original
814 people have browsed it

How to Develop Internet Explorer Extensions for IE8 and IE11?

Develop Internet Explorer extensions

Create an Internet Explorer 11 add-on

  1. Create a class library project (C#, .Net Framework 4.6.1) in Visual Studio.

  2. Add references to Interop.SHDocVw and Microsoft.mshtml.

  3. Create the following files:

    • IEAddon.cs
    • Interop.cs
    • A form containing a text box and an OK button.
  4. In IEAddon.cs:

    • Implement IObjectWithSite and IOleCommandTarget interfaces.
    • Handle document completion events to highlight specific text in a web page.
    • Add registry functions to manage add-in settings and registration.
  5. In Interop.cs:

    • Define the COM interface used by the add-in.
  6. In form:

    • Create a property to get/set the text to highlight.
  7. In project properties:

    • Sign the assembly with a strong key.
    • Set "Start external program" to iexplore.exe.
    • Set the "Post-build event command line" to register the BHO (including manual registration using regasm and gacutil).

How add-ons work

  • Traverse the DOM tree, replacing the specified text with the highlighted version.
  • Adds a JavaScript function to your web page that executes when highlighted text is clicked.
  • Store configuration settings in the Windows registry.

Creating an Internet Explorer 8 add-on

  • Project setup: Similar to IE11 add-in, using Visual Studio 2010 and .Net Framework 4.

  • File: Same as the IE11 add-in, but uncomment a line in IEAddon.cs to prevent multiple executions.

  • Project properties:

    • Use gacutil.exe and RegAsm.exe for 64-bit systems.

Notes on 64-bit IE:

  • Use a 64-bit compiler and registration tool (e.g. RegAsm.exe from Framework64).

The above is the detailed content of How to Develop Internet Explorer Extensions for IE8 and IE11?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template