The use of JS developed by IE Plug-ins can be in the current browsing page to execute JS code, on this basis to achieve any user can think of the function.
You can do some common processing for unused sites (such as extracting some sort of information), or you can do special processing for specific websites (like snapping up train tickets).
The implementation of this plug-in method is relatively simple, just copy a few files, modify a registry value. So it is more suitable for fast implementation of some browser or web accessibility features.
Implementation steps:
1. Create HTML files that implement specific functionality
Copy Code code as follows:
File name: getticketslist.html
File contents:
<script language= "JavaScript" >
var args = external.menuarguments;
var doc = args.document;
var cframe = doc. Contents_iframe;
if (cframe && cframe.document) {
Doc = cframe.document;//Gets the document element for the current page
TODO: Get the ticket list element from document and handle it accordingly
}
</script>
2. Create a registry file
Copy Code code as follows:
File name: Getticketslist.reg
File contents: The CLSID in the file can be modified arbitrarily, the only
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" = "Handle Tickets"
3. Copy the HTML file to the path specified in the reg file (such as c:\getticketslist.html)
4. Run Getticketslist.reg, modify the registration form
5. Restart IE, in the menu "tool" You can see just added the function "Processing tickets", click to perform