General questions about Plugins
How to implement "Config" function of a Plugin
How to add new or override existing protocols
How to make a "Button" type plugin
How to make a "SideBar" type plugin
Extended DHTML support
General questions about Plugins:
1. COM Object
COM object must implement IMyIEClient interface. Please refer to IMyIE.h
2. Exe File:
Any win32 exe file could be used as plugin. MyIE2 will send different parameters
under different circumstance.
General parameter:
a. "-h=handle" : handle is the Wnd handle of the MyIE2 main window,
decimalist.
3. Script File:
Script File must be written in the following format:
Example:
<script language="Javascript">
alert(document.lastModified);
</script>
The 'language' could be any valid language that IE supports.
How to implement 'Config' function of a
Plugin?
There is a 'Config' button in the 'MyIE2 Plugin' option page. MyIE2 will call the corresponding 'Config' function of a plugin, when user clicks the 'Config' button.
1. COM Object:
The COM's IMyIEClient::Config will be call with the parameter of the config dialog's hWnd handle.
2. Exe File:
The file will be called with a parameter of "-setup". For example, if the filename is "abc.exe", then MyIE2 will call "abc.exe -setup ..." .
3. Script File:
Not support currently...
How to add new or override existing protocols?
With MyIE2, the plugin could estanblish a new protocol, such as book://, or override an existing protocol, such as ftp:// .When the user inputs the protocol in the address bar or clicks the protocol on webpage, MyIE2 will call the plugin.
1. COM Object:
Not support currently...
2. Exe File:
The file will be called with the parameter "-u=url", in which the url is the address that the user wants to visit, such as book://www.mysite.com/abc.pdf, or ftp://www.google.com .
3. Srcipt File:
Not support currently...
How to make a "Button" type plugin?
MyIE2 supports "Button" type plugins, which will be placed on "Ext Button" toolbar. The plugin is called when user clicks on the corresponding button. The 'Button' plugin could be implemented using the following methods.
1.COM Object:
When user clicks on the button, MyIE2 will query the Com's IOleCommandTarget
interface and ║═IObjectWithSite interfaceú¼passing the IWebBrowser2 pointer of
the current page to its IObjectWithSite::SetSite functionú¼then call its IOleCommandTarget::Exec
function. It's similar to IE's implementation of button. Please refer to MSDN
for more information.
Sample Plugin.ini:
[General]
Name=ComButton
Author=bloodchen
Version=1.0
ModuleType=COM
FileName=ComButton.dll
CLSID={96E78121-9FF2-466D-B6CD-4038CAC1BB79}
Comments=Com type 'Button'
Type=BUTTON
HotIcon=hot.ico
Icon=cold.ico
2.Script:
When the user clicks the button, MyIE2 will run the script on current web page.
Sample Plugin.ini:
[General]
Name=LastModified
Author=bloodchen
Version=1.0
ModuleType=SCRIPT
FileName=LastModified.htm
Comments=See last modified date of current page
Type=BUTTON
HotIcon=hot.ico
Icon=cold.ico
3.Exe File:
When the user clicks the button, MyIE2 will call the file with the parameters
of current address and handle of the main MyIE2 window. For example, the file
is abc.exeú¼then MyIE2 will call abc.exe -h=23424 -u=http://www.yahoo.com, in
which 23424 is the handle of the main MyIE2 window and http://www.yahoo.com
is the URL of the current page.
Sample Plugin.ini:
[General]
Name=ExeButton
Author=BloodChen
Version=1.0
ModuleType=EXE
FileName=abc.exe
Comments=Exe type Button
Type=BUTTON
Icon=p.ico
How to make a 'SideBar' type plugin
MyIE2 supports 'SideBar' pluginú¼This kind of plugin will appear on MYIE2's sidebar, implemented using a html file.
1.HTML:
When user clicks on the buttonú¼MyIE2 will load the html file into the side bar
, which is assigned in the plugin.ini.
Example Plugin.ini:
[General]
Name=Calculator++ 1.2
Author=SiC
Version=1.2
ModuleType=SCRIPT
FileName=calculator.htm
Comments=Scientific programmable calculator.
Type=Sidebar
HotIcon=cpp.ico
Icon=cpp.ico
MYIE2 has extended the DHTML support by adding several new commands which could be called from script langauge. The HTML or scirpt writer could call the function through the 'window.external' object. The function could be called from the script in a HTML page or a scirpt plugin.