I have a specific request related to GreaseMonkey. I am trying to make a GET request using GM_xmlhttpRequest to fetch content from a page that loads some of its content after an initial progress bar (due to AJAX). My goal is to retrieve the complete contents of the page only after everything has been fully loaded, so I am seeking a way to introduce a delay in the request. Is it possible? If so, how can I achieve this?
To clarify further, my current code is similar to 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);
}
});
Instead of "example.com," the actual page I am dealing with initially loads but then dynamically loads its main contents after a delay. However, the response.responseText only captures the initial load HTML.
Thank you!