You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
2.0 Error: Argument 1 of Document.adoptNode is not an object. #1937
On the xpi file modules\xmlhttprequester.js,add try{} catch(e){}, then this script work fine.
if (req.responseXML) {
// Adopt the XML object into a content-window-scoped document.
try {
var xmlDoc = wrappedContentWin.Document();
xmlDoc.appendChild(xmlDoc.adoptNode(req.responseXML.documentElement));
responseState.responseXML = xmlDoc;
} catch(e) {}
}
Activity
ywzhaiqi commentedon Jun 18, 2014
when run this code
An error occurred:
Argument 1 of Document.adoptNode is not an object.responseDetails.responseText
ywzhaiqi commentedon Jun 18, 2014
On the xpi file
modules\xmlhttprequester.js,addtry{} catch(e){}, then this script work fine.arantius commentedon Jul 8, 2014
I definitely see problems related to GM_xhr in 2.0. 3bfe3c9 helps a bit; I'm not sure if this is a GM 2.0 or a recent Firefox change.
Also: https://bugzilla.mozilla.org/show_bug.cgi?id=1031336#c17 shows an approach to improve this even more, securely. Though I can't reproduce quite the error described.
Fix GM_xmlhttpRequest callback access.
Keep the `this` of GM_xhr callbacks set to the details object.
arantius commentedon Jul 21, 2014
Not completely fixed, see #1937.
Clone the responseXML.documentElement in GM_xhr callbacks.