Firefox extension on every page

I am new to developing Firefox extensions. I am creating an extension that needs to be launched for each page that the user is viewing. Currently, the extension starts when the Firefox window starts. I pasted the 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">
<script type="application/x-javascript" src="chrome://myextension/content/myextension.js" />
</window>

and in the javascript file myextension.js I have a warning (window.location.href);

I want to run this extension and get the URL of the page that I view every time.

I could go in the wrong direction. Any help is greatly appreciated.

+3
source share

Source: https://habr.com/ru/post/1720124/


All Articles