javascript detect page

JavaScript
if ( document.URL.includes("homepage.aspx") ) {
    //Code here
}

Source

Also in JavaScript: