views:

205

answers:

1

I am new to firefox extension development. I am building an extension which needs to run for each page the user browses. At the moment the extension runs when firefox window starts. I have pasted code below.

XUL Code:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="mainWin" title="my extension" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
<script type="application/x-javascript" src="chrome://myextension/content/myextension.js" />
</window>

and in the myextension.js Javascript file I have an alert(window.location.href);

I want to run this extension and get the url of the page I am browsing each time.

I might be going in a wrong direction. Any help much appreciated.