структура:
/sample
-install.rdf
-chrome.manifest
/chrome
/content
-sample.xul
-main.js
install.rdf:
<?xml version="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>sample@example.net</em:id>
<em:version>1.0</em:version>
<em:type>2</em:type>
<!-- Target Application this extension can install into,
with minimum and maximum supported versions. -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>4.0.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>sample</em:name>
<em:description>A test extension</em:description>
<em:creator>Your Name Here</em:creator>
<em:homepageURL>http://www.example.com/</em:homepageURL>
</Description>
</RDF>
chrome.manifest:
content sample chrome/content/
overlay chrome://browser/content/browser.xul chrome://sample/content/sample.xul
sample.xul:
<?xml version="1.0"?>
<overlay id="sample"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://sample/content/main.js" />
<statusbar id="status-bar">
<statusbarpanel id="my-panel" label="Hello, World!" />
</statusbar>
</overlay>
main.js:
window.addEventListener('load', foo, false);
function foo() {
alert('foo');
}
как сделать что бы alert срабатывал после каждой загрузки страницы, а то сейчас появляется только при создании нового окна