Short answer: you cannot .
You cannot access the document object of "any web page" using JavaScript on your page if it is in a different domain, which I assume if you say "any web page" because of the same origin policy . To do this, you will need a website in IFRAME to work with your script, which is not the case with "any web page."
IFRAME in the same domain
If your web page is in the same domain, you can access the events of the body IFRAME element by adding a listener for each event that you want to catch, as described here . This is possible for all events that create bubbles in the body. Therefore, if you have events that cannot bubble up the body, they will not catch this decision.
jQuery('#website body').on('click mouseover mouseout', function(event) { console.log(event.type); });
Assuming you have an IFRAME with the website identifier, you can catch the events you want by listing them, separated by spaces, as indicated above. In the example, we get click , mousover and mouseout .
Maybe this is closer to what you want?
migg
source share