[Greasemonkey] GM 0.6.4 and new DOMParser()

Joe la Poutre jsixpack at gmail.com
Fri Dec 2 15:10:31 EST 2005


Have a look at Mark Pilgrim's article for O'Reilly:

This happens to be hack #12 from his excellent book Greasemonkey Hacks.

Getting to your question, my work around for DOM parser:

// snippet...
if (typeof(XPCNativeWrapper) == "function") {
	var dp = new XPCNativeWrapper(window, "DOMParser()");
	var parser = new dp.DOMParser();
	var DOM = parser.parseFromString(gReq.responseText, "application/xhtml+xml");

Either window or unsafeWindow work as first argument to
XPCNativeWrapper, not sure which is best (see my question earlier on
this list).



On 12/1/05, John Plsek <jplsek at iinet.net.au> wrote:
> OK, I need DOMParser to work ... why is it broken in GM0.6.4?? Is there
> a workaround???
> Where is that definitive list of GM 0.6.x traps from us poor GM
> scripters??? new Image() isn't working, now new DOMParser() .... when
> will it end
> John
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey

More information about the Greasemonkey mailing list