Permission denied to call method Element.getAttribute

116 views
Skip to first unread message

SamCKayak

unread,
Jun 7, 2008, 1:40:13 PM6/7/08
to Firebug
I'm running Firefox 3.0 RC2, Firebug 1.2.0b3. I've got one web app to
work on that uses the following JavaScript to read an XMl file of quiz
questions:

1197 this.randomizeQuestionSequence =
xml.getAttribute("randomizeQuestionSequence") === "true";
1198 this.randomizeAnswerSequence =
xml.getAttribute("randomizeAnswerSequence") === "true";
1199 this.recordInteractions = xml.getAttribute("recordInteractions")
=== "true";

This web app runs perfectly in IE6, 7 and Firefox without Firebug
installed. When I install Firebug, I get a JavaScript error:

Permission denied to call method Element.getAttribute

I'm running Windows VISTA. Could this be a permission problem because
users do not run with Administrative permission? I've launched
firefox with Admin permissions and I still get the error.

Any help?

Jan Odvarko

unread,
Jun 9, 2008, 9:42:55 AM6/9/08
to Firebug

SamCKayak

unread,
Jun 9, 2008, 4:13:14 PM6/9/08
to Firebug
I followed the link and tried the link that demo'ed the fault (http://
ajaxian.com/archives/some-more-javascript-performance-tips)

No problem found. Not sure if that concludes that I've got another
problem.

Is there anything I can do short of posting a URL to demo the
problem? The thing is... it requires login... can't pass that around.

John J Barton

unread,
Jun 9, 2008, 4:43:39 PM6/9/08
to Firebug
Sam, I haven't had much luck in solving these kinds of error
messages. Its not about Vista or OS. The error is from the Mozilla
world somewhere and it has to do with web pages vs browser/extension
code. But the messages don't have enough information to say more than
that. You can try to make a small test case, but still I don't know
if that will help.

John.

SamCKayak

unread,
Jun 10, 2008, 12:18:53 PM6/10/08
to Firebug
I'll try to put together a test case in the weeks ahead. This problem
has kept me from using Firebug on this project for months. Very sad
once you know what Firebug brings to the table.

Sam

John J Barton

unread,
Jun 10, 2008, 12:40:11 PM6/10/08
to Firebug
Some things you can try:
1) Set Script->BreakOnError see what happens when you run over the
error
2) Load the traced version of Firebug 1.2X, set FBTrace ERRORS on and
FBS_ERRORS on.
or
3) Set Script->Track Throw Catch.

Doe is matter which Firebug panel you have on top?

I've complained about these error messages to Mozilla, without results
as yet.

John.

py

unread,
Jun 18, 2008, 8:41:12 PM6/18/08
to Firebug
FWIW, here is a minimal example of how to trigger this problem -- its
been hampering me as well.

this code breaks on FF3 when firebug is on.
works on FF3 with firebug off.
works on FF2 with firebug on or off.

needs two files.

1) test.html: on body load call test();
2) test.xml: some little xml doc to be loaded.

=== in test.html ===
var doc;
function test(){
doc = document.implementation.createDocument("", "", null);
doc.onload = function(e){
alert(doc.firstChild.getAttribute("id")); //<--HERE
};
doc.load("test.xml");
}

=== and in test.xml ===
<thing id="theid">
<foo/>
</thing>

John J Barton

unread,
Jun 19, 2008, 1:35:13 AM6/19/08
to Firebug
Thanks for the nice test case:
https://bugzilla.mozilla.org/show_bug.cgi?id=440275

maxx

unread,
Jun 20, 2008, 10:14:47 AM6/20/08
to Firebug
New test try this one, the same issue but with NodeType and nodeValue:
<HTML>
<head>
<script>
var doc;
function test(){
doc = document.implementation.createDocument("", "", null);
doc.onload = function(e){
// alert(doc.firstChild.getAttribute("id")); //<--HERE


var idArray = new Array();


var siteNodes = doc.getElementsByTagName("site");

if(siteNodes.length < 1)
{
// debug('getSiteIdList() - No site nodes found');
return false;
}

for(var i=0; i< siteNodes.length; ++i)
{
// Netscape/Mozilla will return whitespace as a node so check that
it is a valid node with children
if(siteNodes[i].nodeType != 1)
continue;

// Search directly for siteId tag, will return array of nodes, use
element 0 since only one child of that
// node will qualify. Use node value of first child since text
inside is considered child node.
var siteIdNodes = siteNodes[i].getElementsByTagName("siteId");
if(siteIdNodes && siteIdNodes[0].hasChildNodes())
idArray.push(siteIdNodes[0].firstChild.nodeValue);

// debug('getSiteIdList: found ' +
siteIdNodes[0].firstChild.nodeValue);
}

return idArray;



};
doc.load("test.xml");
}
</script>
</head>
<body onload="test()">
test
</body>
</HTML>
test.xml
<?xml version="1.0" encoding="UTF-8"?>
<sites>
<site>
<siteId>site_4803b90d7deea</siteId>
<publishDirectory></publishDirectory>
<designId>366</designId>
<tint>default</tint>
<title></title>

<tagline></tagline>
<lastPublished>04/14/2008 21:11:59 GMT</lastPublished>
<rssFeed></rssFeed><atomFeed></
atomFeed><lastModifiedTime>1213191015</
lastModifiedTime><lastModified>06/11/2008 13:30:15 GMT</lastModified></
site>
<site><siteId>site_485bb4acbd7e1</siteId><publishDirectory></
publishDirectory><designId>33</designId><tint>default</tint><title>My
New Website</title><tagline>mgritsay.hostopia.com</
tagline><lastPublished></lastPublished><lastModifiedTime>1213969580</
lastModifiedTime><lastModified>06/20/2008 13:46:20 GMT</lastModified></
site><site><siteId>site_485bb4b387bfd</siteId><publishDirectory></
publishDirectory><designId>33</designId><tint>default</tint><title>My
New Website</title><tagline>mgritsay.hostopia.com</
tagline><lastPublished></lastPublished><lastModifiedTime>1213969587</
lastModifiedTime><lastModified>06/20/2008 13:46:27 GMT</lastModified></
site></sites>

John J Barton

unread,
Jun 20, 2008, 11:38:20 AM6/20/08
to Firebug
Please follow up on the bugzilla report noted earlier. This is not a
problem Firebug can fix.
Reply all
Reply to author
Forward
0 new messages