--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/greasemonkey-users/-/Lncz1bVch0QJ.
To post to this group, send email to greasemon...@googlegroups.com.
To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/greasemonkey-users/-/2kGRMNHKf-4J.
To post to this group, send email to greasemon...@googlegroups.com.
To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
var lang = new DOMParser().parseFromString(response.responseText, "text/xml").getElementsByTagName('title')[0].getAttribute('lang');
GM_xmlhttpRequest({
method: "GET",
url: "http://www.example.net/",
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) {
// Inject responseXML into existing Object (only appropriate for XML content).
if (!response.responseXML) {
response.responseXML = new DOMParser()
.parseFromString(response.responseText, "text/xml");
}
// create response.lang
response.lang = response.responseXML.getElementsByTagName('title')[0].getAttribute('lang');
GM_log([
response.status,
response.statusText,
response.readyState,
response.responseHeaders,
response.responseText,
response.finalUrl,
response.responseXML,
response.lang,
].join("\n"));
}
});