Skip to content

Instantly share code, notes, and snippets.

@irwynks
Created May 12, 2016 20:22
Show Gist options
  • Save irwynks/a878177a073c7054d4499a20da2d52ba to your computer and use it in GitHub Desktop.
Save irwynks/a878177a073c7054d4499a20da2d52ba to your computer and use it in GitHub Desktop.
GM_xmlhttpRequest({
method: "GET",
url: "https://www.mediawiki.org/wiki/User:Bcoughlan/Login_with_curl?action=render",
headers: {
"User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used.
"Accept": "text/xml" // If not specified, browser defaults will be used.
},
onload: function(response) {
var responseXML = null;
// Inject responseXML into existing Object (only appropriate for XML content).
if (!response.responseXML) {
responseXML = new DOMParser()
.parseFromString(response.responseText, "text/xml");
}
GM_log([
response.status,
response.statusText,
response.readyState,
response.responseHeaders,
response.responseText,
response.finalUrl,
responseXML
].join("\n"));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment