This is my Extension code:
chrome.manifest file
content ActiveXSupporter content/
overlay chrome:
install.rdf
="1.0"
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>nupur.parashar09@gmail.com</em:id>
<em:name>ActiveXSupporter</em:name>
<em:version>1.0</em:version>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>11.0.*</em:maxVersion>
</Description>
</em:targetApplication>
<em:creator>Nupur Parashar</em:creator>
<em:description>This Extension will help running site containing ActiveX content.</em:description>
<em:homepageURL>http://www.yoursite.com/</em:homepageURL>
</Description>
</RDF>
activeXsupporter.js
function myExtension(evt)
{
alert('Extension Called');
var theFile = 'C:\Users\e3005531\Desktop\q.txt';
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
file.initWithPath( theFile );
if(file.exists() == false)
{
file.create( Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420);
}
var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);
foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
var converter = Components.classes["@mozilla.org/intl/converter-output-stream;1"].createInstance(Components.interfaces.nsIConverterOutputStream);
converter.init(foStream, "UTF-8", 0, 0);
converter.writeString('Hi, This is Death. Who are you?');
converter.close();
alert('finished Writing');
}
document.addEventListener("MyExtensionEvent", myExtension, false, true);
activeXsupporter.xul
="1.0"
<overlay id="Scrapper-Overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><script type="application/x-javascript" src="chrome://activeXsupporter/content/activeXsupporter.js" />
</overlay>
My page's javascript Code
var element = document.createElement("MyExtensionDataElement");
var ev = document.createEvent("Events");
ev.initEvent("MyExtensionEvent", true, false);
element.dispatchEvent(ev);
These are the codes m using.. But still i am unable to call this extension. Where am i doing wrong?