Должно выглядеть так,видимо файл с черновиком перепутал. Сама команда document служит точкой входа для получения содержимого веб-страницы
document .querySelectorAll('body *:not(script):not(style):not(noscript):not(svg):not(path):not(option)') .forEach(function(elem) { if (result.frame === false){ result.frame = checkElementFrame(elem); } if (result.object === false){ result.object = checkElementObject(elem); } if (result.embed === false){ result.embed = checkElementEmbed(elem); } if (result.frame === true && result.object === true && result.embed === true ){ return result; } });