I want to add some DOM elements to another extension's XUL file.
That extension allows itself to be "opened" by clicking on a toolbar button that it adds to Firefox. Clicking on this button opens a new tab with the chrome address of an XUL file that is part of the extension.
I have already created some DOM elements dynamically and added them to elements on the Firefox window (e.g. the previously mentioned toolbar) by both adding them when my add-on is loaded and using window "load" event listeners for windows opened after my add-on is loaded (using document.createElement()
and element.appendChild()
), but I am not sure about the best way to add dynamic elements to this XUL file that can be opened and closed multiple times in the same window.
Is there any way to overlay the XUL file one time per session (I am guessing not)? Otherwise, do I need to set up some kind of page load listener that fires every time a page loads and then checks the address to see if it matches the XUL file's address and does the overlay if so? Is it possible to listen for a specific address?