[Greasemonkey] XPCNativeWrappers and Deer Park compatibility

Mark Pilgrim pilgrim at gmail.com
Sat Jul 30 15:51:44 EDT 2005

On 7/29/05, Phil Ringnalda <philringnalda at gmail.com> wrote:
> Because you can never have too much fury: you might need to retest
> everything about the limits of XPCNativeWrappers, with a build from
> after 200507290811. I don't really understand what bz was talking
> about through most of
> https://bugzilla.mozilla.org/show_bug.cgi?id=296967 but the commit
> message "Makes native wrappers work in lots of nasty DOM0 corner
> cases" certainly sounds like "Make Mark retest 50 or 60 scripts" to
> me.

Nightly build 2005-07-30T08:31 breaks XPath in Greasemonkey scripts
(tested with both GM 0.4.2a3 and 0.4.999a1).

var snapResults = document.evaluate("//*", document, null,

always throws

Error: null has no properties
Source File: testxpath.user.js
Line: 1
Source Code:

The problem is the third parameter, which can be an NSResolver
function (or null, allegedly).  If I define a dummy function, it gets
past that but I get a different error.

var snapResults = document.evaluate("//*", document, function() {
return ''; }, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

Error: XPathResult has no properties
Source File: testxpath2.user.js
Line: 1
Source Code:

Again, this is not due to the changes in GM 0.4.999a1, because it ONLY
happens in Firefox-nightly-2005-07-30 (not Deer Park alpha 2, not
Firefox 1.0.6), and it happens with ANY version of Greasemonkey
(tested with 0.4.2a3 and 0.4.999a1).  Presumably it's due to the
changes they made in that bug that Phil referenced (296967).  I
mention it here to warn GM scripters to stay away from the nightlies
for a while, and in the hope that Phil can turn around and report it
to the appropriate Mozilla hackers the next time he catches them on
IRC (where all real decisions are made).


More information about the Greasemonkey mailing list