XUL adding to JavaScript
Can a XUL extension in Firefox add extra JavaScript functions or objects that ordinary HTML pages can use? Say I wanted to add a getElementsByClassName method to the document object so my pages could use it directly as long as the extension was installed in my browser: is that possible?
Yes, I know it wouldn’t work for everyone else. There is a point here. :)
Er. That seems like the sort of thing I should have thought of before, but haven’t. Not the most direct path, but “userscript.js”:http://gratisdei.com/FF.htm#userscript is an extension that stuffs your choice of any script you like into every page after it fires the load event. Since you don’t have their need to undo things, you could borrow bits from that, without waiting, but you would need a hook for “the DOM is just barely started, but far enough along that you can add a child to document.head and have it there before anything else.” Um. ‘Scuse me while I go drink a pot of coffee or two.
3 hours later