First register the overlay on browser.xulin the manifest file:
overlay chrome://browser/content/browser.xul chrome://sample/content/sample.xul
Then include JavaScript in yours sample.xul. This JavaScript should attach an event handler to the window onload. This will fire every time a new browser window opens and your code runs.
, , , XPCOM, profile-after-change, , , , .