I'm playing on the webbrowser and keeping AD in its own window on a separate screen, but it still loses performance if I dont click on the window every few minutes. I tried a script that stops the page from becoming hidden, but it doesnt work. I don't know enough if its cause the code has something wrong, or if it cant solve the problem I have even if it does work.
The code:
await page.evaluate(`
Object.defineProperty(window.document,'hidden',{get:function(){return false;},configurable:true});
Object.defineProperty(window.document,'visibilityState',{get:function(){return 'visible';},configurable:true});
window.document.dispatchEvent(new Event('visibilitychan