if I am trying to execute a warning to the console every time the url switched how would I exclude a website such as twitter.com/(username)/topics if the username is unique to the user every time
let lastUrl = location.href;
new MutationObserver(() => {
const url = location.href;
if (url !== lastUrl) {
lastUrl = url;
onUrlChange();
}
}).observe(document, {subtree: true, childList: true});
`window.__ttrExcludeUrls = ["https://twitter.com/explore",` "https://twitter.com/home","https://twitter.com/notifications", "https://twitter.com/messages", "https://twitter.com/i/bookmarks","https://twitter.com/i/moment_maker","https://.twitter.com/i/*"];
function onUrlChange()
{
console.warn("URL changed", location.href);
if(window.__ttrExcludeUrls.includes(location.href) == false)
{
console.log("THIS IS A TEST MESSAGE")
}
else
{
console.warn("WRONG URL")
}
if(location.href == "https://twitter.com/home")
{
console.warn("WRONG URL")
}
}