I've included jQuery by doing this:
<?xml version="1.0"?>
<!DOCTYPE window SYSTEM "chrome://orkutmanager/locale/browser.dtd">
<overlay id="omcore"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="../../jquery-1.4.2.js"/>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="application/x-javascript" src="../../OM.js"/>
</overlay>
Here is my chrome.manifest
content orkutmanager chrome/content/
overlay chrome://browser/content/browser.xul chrome://orkutmanager/content/XUL/Browser/Core.xul
skin orkutmanager classic skin/
locale orkutmanager en-US locale/en-US/
And then I tried to use
gBrowser.addEventListener('DOMContentLoaded',
function (e)
{
var contentWindow = e.originalTarget.defaultView;
var contentDocument = contentWindow.document;
var $ = jQuery;
var x = $("a", contentDocument).attr("onclick"); //
// Error: uncaught exception: unknown (can't convert to string)
}, false);
While
$("a", contentDocument).get(0).getAttribute("onclick");
Works normal.
Do I have to include jQuery in a different way? How can I make it work as usual? Is there another jQuery method to get the value of an attribute?
On a normal case it works, example here.