Prototype 1.6 security exception in firefox 2.0.0.20 in XPath code

16 views
Skip to first unread message

swindsor

unread,
Jun 12, 2009, 10:00:07 PM6/12/09
to Prototype: Core
Hey all,

I'm running into a pretty severe bug with protoype 1.6 (and 1.5) with
firefox 2.0.0.20

When prototype loads, I get the following javascript error:

Error: uncaught exception: [Exception... "Security error" code:
"1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location:
"http://localhost:3000/javascripts/prototype.js?1244843092 Line:
1525"]

Looking at the code, this is the line where it's erroring:

if (Prototype.BrowserFeatures.XPath) {
document._getElementsByXPath = function(expression, parentElement) {
var results = [];
var query = document.evaluate(expression, $(parentElement) ||
document,
null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); //////
ERROR /////
for (var i = 0, length = query.snapshotLength; i < length; i++)
results.push(Element.extend(query.snapshotItem(i)));
return results;
};
}

This doesn't error in newer versions of firefox 3.0, 3.1 beta, but as
a result, after this exception is thrown I can't use any other
protoype javascript on the page (or any jquery, because the noconflict
fails).

Is this a bug in firefox or in prototype?

kangax

unread,
Jun 13, 2009, 5:18:33 PM6/13/09
to Prototype: Core
I can not reproduce this with trunk version of prototype and
FF2.0.0.20 on MacOSX.

--
kangax

dmitrymos

unread,
Jun 19, 2009, 10:37:08 AM6/19/09
to Prototype: Core
Do you use both prototype, and jquery on the same page? Probably that
might be the problem.
I use prototype 1.6.1_rc2 on Windows XP FF 2.0.0.20
There is no such error.

On Jun 12, 10:00 pm, swindsor <swind...@gmail.com> wrote:

upi

unread,
Jun 24, 2009, 10:17:03 AM6/24/09
to Prototype: Core
I had the very same problem and solved it by changing the order:
1) include jquery
2) setting jQuery.noConflict().
3) include prototype & scriptaculous

Scott Windsor

unread,
Jun 24, 2009, 8:10:55 PM6/24/09
to Prototype: Core
Thanks, I am using jquery. I'll give this a try!

- scott

Scott Windsor

unread,
Jun 26, 2009, 4:15:26 AM6/26/09
to Prototype: Core
That did the trick. Odd that this only caused an issue in firefox 2.
Anyway, thanks!

- scott
Reply all
Reply to author
Forward
0 new messages