Can you give me more information on how this can be best resolved if there is a way?
Only the developer can solve this problem. You can avoid this problem if you don't allow one browser to take up more than 3-4gb of RAM (Removing unnecessary or used elements on the page).
@yourfriendkarol
This code contains an event handler. It should be added to the page before it is downloaded (preferably). Use "Browser -> execute every time the page loads". From "Tools -> execute the code" access to the root object "windows" is not. From this error there is - no "windows.document"