I need to do some movements on page while page exists (or is opened). But other async code can close it in any time. I try to use code, like this:
async.whilst(
function(){ /*TEST function: return true if page is opened or false otherwise*/},
function (cb){
(async()=>{
await page.evaluate(_=>{/*some code*/})
})();
},
callbackopt
)
How can I know, if page is opened or closed, to pass this code to the test function?