Is there a way to listen for URL changes/redirects in Puppeteer? For example if I point the browser to http://www.somesite.com/home and it redirects to http://www.somesite.com/login, I would like a way to observe these changes and then terminate the current action.
I tried this:
await page.setRequestInterception(true);
page.on('request', interceptedRequest => {
console.log(interceptedRequest.url());
interceptedRequest.continue();
});
but this is just all the requests. It doesn't log when the url changes.