@MAB-Tech There is too little information to assume anything.
Please answer the question, or better yet, attach the project that is causing the problem to the forum's private messages.
@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"