I need to detect mouse clicks after page loads and the function is exectued which deletes ads.
After the mouse click is detected, it will compare the URLs and it should do this on every mouse click.
I have tried using Google's stuff, but couldn't figure out, so I switched to plain JS.
let host = window.location.host; // www.adjaranet.com
let path = window.location.pathname; // /...
let href = window.location.href; // http
// alert(path); // movie section = /Movie/main // homepage = /
if (href == "https://www.adjaranet.com/") {
function deletor() {
// some code that executes...
}
deletor();
// Here I want to detect mouse clicks and then compare the URLs
}
And if mouse is clicked and the page is changed (url), it should run another separate function.