I'm writing a Chrome extension that searches for posts in a Google Group whose subject lines contain a given character string. From the browser, using the search query "subject:", I get the search results: either 0 results or > 0 and I take different actions depending on whether results come up. The wrinkle is that if I simply fetch the page data for the results page using, say,
try
{
var request = new XMLHttpRequest();
request.open("GET", url, false);
request.send(null);
}
catch (e)
{
console.log(e);
return;
}
if (request.status == 200)
{
var tmp = request.responseText;
}
I just get obfuscated data and can't read it. If I can get a Document object back, then I can search for a certain classname, with something like doc.getElementsByClassName, that exists if and only there are non-zero results from the search.