Is it possible to monitor the contents of a secondary page from a link on the source page?
I am using javascript to click a link on the source page, waiting for the second page to load, and then trying to read contents of the second page, but it does not seem to work.
Here is a simple public example for ebay.com where I want to query information on the page linked from the ‘sell’ button.
function wait() {
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, 2000)
});
}
async function msg() {
document.querySelector('a[href*="sell"]').click() // this line breaks the monitor
await wait()
insertDiv = document.createElement('div')
insertDiv.innerHTML = document.URL
document.body.append(insertDiv)
sendResponse("", insertDiv)
}
msg();
My actual use case is a bit more complicated. My source page’s link is not query-able (It is not a simple anchor tag with a url. Which means I cannot fetch the address and run a ajax request. The address is only created dynamically onclick.).
Additionally, I don’t think the page I am interested in is actually requesting a new ‘doc/page’. I think it is simply manipulating the current page and modifying the window.history. In either case I can’t get distill to query any data after clicking a link on the source page.