Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>While you can "compile" a GreaseMonkey script (see Brock's answer), this solution isn't exactly well-supported. The more reliable option would be using the <a href="https://developer.mozilla.org/en-US/Add-ons/SDK" rel="nofollow">Add-on SDK</a> and <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_Started_%28jpm%29" rel="nofollow">JPM</a>. Your <code>lib/main.js</code> file can be really simple (<a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/page-mod" rel="nofollow"><code>page-mod</code> module documentation</a>):</p> <pre class="lang-js prettyprint-override"><code>var data = require("sdk/self").data; var pageMod = require("sdk/page-mod"); pageMod.PageMod({ include: "*.example.com", contentScriptWhen: 'end', contentScriptFile: data.url("contentScript.js") }); </code></pre> <p>This is equivalent to the following GreaseMonkey script header:</p> <pre class="lang-js prettyprint-override"><code>// @include http://example.com/* // @include http://*.example.com/* </code></pre> <p>And then you add your GreaseMonkey script as <code>data/contentScript.js</code> (Add-on SDK will ignore the GreaseMonkey header, the info is specified elsewhere) and build the extension. In most cases it will just work - unless your GreaseMonkey script uses any special GreaseMonkey API of course, in which case you will need to find a replacement. <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Guides/Content_Scripts/Interacting_with_page_scripts#Access_objects_defined_by_page_scripts" rel="nofollow"><code>unsafeWindow</code> is supported</a> by the way (usual warnings apply).</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. 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