This is a GreaseMonkey specific request. I'm trying to use the GM_xmlhttpRequest to make a GET request to a page (cross domain). The problem is, the target page fetches a lot of its content after the page has been loaded once (and until then it shows a progress bar for a few seconds) when opened in the browser (again through AJAX). I want to fetch the contents of this page only when everything has been loaded, so am simply looking for a way to add a few seconds delay in the request. Is it even possible? If yes, how can I do that?
Edit: I think I'm not clear enough. I am calling a page like this:
GM_xmlhttpRequest({
method: "GET",
url: "http://example.com",
onload: function(response) {
if(response.responseText.length > 0)
{
callBack(response.responseText);
}
},
onerror: function(response) {
log("Error in fetching contents: " + response.responseText);
}
});
The page I'm actually using instead of example.com loads once but then delay loads its useful contents. but the response.responseText only contains the initial load HTML.
Thanks!