Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I use the following <code>example.xul</code>:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;overlay id="example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt; &lt;head&gt;&lt;/head&gt; &lt;script type="application/x-javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="application/x-javascript" src="example.js"&gt;&lt;/script&gt; &lt;/overlay&gt; </code></pre> <p>And here is an <code>example.js</code></p> <pre><code>(function() { jQuery.noConflict(); $ = function(selector,context) { return new jQuery.fn.init(selector,context||example.doc); }; $.fn = $.prototype = jQuery.fn; example = new function(){}; example.log = function() { Firebug.Console.logFormatted(arguments,null,"log"); }; example.run = function(doc,aEvent) { // Check for website if (!doc.location.href.match(/^http:\/\/(.*\.)?stackoverflow\.com(\/.*)?$/i)) return; // Check if already loaded if (doc.getElementById("plugin-example")) return; // Setup this.win = aEvent.target.defaultView.wrappedJSObject; this.doc = doc; // Hello World this.main = main = $('&lt;div id="plugin-example"&gt;').appendTo(doc.body).html('Example Loaded!'); main.css({ background:'#FFF',color:'#000',position:'absolute',top:0,left:0,padding:8 }); main.html(main.html() + ' - jQuery &lt;b&gt;' + $.fn.jquery + '&lt;/b&gt;'); }; // Bind Plugin var delay = function(aEvent) { var doc = aEvent.originalTarget; setTimeout(function() { example.run(doc,aEvent); }, 1); }; var load = function() { gBrowser.addEventListener("DOMContentLoaded", delay, true); }; window.addEventListener("pageshow", load, false); })(); </code></pre>
 

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