IE plug-in developed using js can execute js code in the currently browsed page, and on this basis, it can implement functions that any user can think of.
You can do some common processing for unused websites (such as extracting certain types of information), or you can do special processing for specific websites (such as buying train tickets).
The method to implement this plug-in is relatively simple. You only need to copy a few files and modify a registry value. Therefore, it is more suitable to quickly implement some browser or website auxiliary functions.
Implementation steps:
1. Create an html file that implements specific functions
The code copy is as follows:
//File name: getticketslist.html
//File content:
<script language="javascript">
var args = external.menuArguments;
var doc = args.document;
var cframe = doc.CONTENTS_IFRAME;
if (cframe && cframe.document) {
doc = cframe.document;//Get the document element of the current page
//TODO: Get the ticket list element from the document and do the corresponding processing
}
</script>
2. Create a registry file
The code copy is as follows:
//File name: getticketslist.reg
//File content: The CLSID in the file can be modified at will, and it can be unique.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Internet Explorer/Extensions/{878EC0C9-AAAD-4331-9B3A-2D8BA93AEAD2}]
"CLSID"="{2FBA04EE-3024-11D2-8F1F-0000F87ABD16}"
"Default Visible"="Yes"
"Script"="c://getticketslist.html"
"MenuText"="processing tickets"
3. Copy the html file to the path specified in the reg file (such as c:/getticketslist.html)
4. Run getticketslist.reg to modify the registry
5. Restart IE, you can see the function "processing tickets" just added in the menu [Tools], click Execute