Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no <code>window</code> in a <code>bootstrap.js</code> scope. <code>bootstrap.js</code> is essentially a standalone code module (that is running in a Sandbox, but that's just an implementation detail). It will run only once per application, not once per window.</p> <p>When developing <a href="https://developer.mozilla.org/en/docs/Extensions/Bootstrapped_extensions" rel="nofollow">bootstrapped add-ons</a>, you have to enumerate existing and watch for new windows yourself and "attach" to them as needed. See e.g. the <a href="https://github.com/Mardak/restartless/blob/watchWindows/bootstrap.js" rel="nofollow"><code>watchWindows</code> boilerplate</a>.</p> <p>Here is an example. It assumes you're using the <code>watchWindows</code> boilerplate:</p> <pre><code>function startup(data, reason) { // Callback function called for each browser window (browser.xul) function onwindow(window) { function onkeydown(e) { // XXX: Your code here. } // Bootstrapped add-ons need to clean up after themselves! function onunload() { window.removeEventListener("keydown", onkeypress); } window.addEventListener("keydown", onkeydown); unload(onunload, window); } // Will also fire for existing windows once and upon each new window. watchWindows(onwindow); } </code></pre> <p>Developing bootstrapped add-ons isn't really something I'd recommend when you're new to Firefox add-ons, XUL/XPCOM and the mozilla platform in general. You probably should check out XUL overlay-based add-ons or the Add-on SDK.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload