Intercept URLs before navigation

I would like to intercept any url that the user enters into their browser and do some tasks before allowing navigation to continue (any way could be good - like connecting through a proxy or any other creative suggestion). To clarify - I don't mean the specific application to be caught, but rather, any navigation that the user does in his browser should be caught (i.e. the user does not open my application, he should be running in the background, or something like that ...) Thanks in advance ...

+1


source to share


4 answers


I don't think you can "intercept" what the user enters through javascript. It smells like a big explosion of security. You can detect when a user leaves the page, but you cannot determine where they will be next.

  • A proxy is a good choice if you only want the url string to be processed. But something more complex will be difficult to implement in a proxy.

  • The plugin, however, depends on which browser you are targeting, you cannot make a single plugin that targets all browsers and control user navigation at the same time. But if you can choose which browser your user is using, then maybe.

  • How do I copy my own browser (using an IE ActiveX control) or use one of the open source alternatives and use that?



What kind of precise processing do you want to do?

+1


source


If you are using Javascript, there is an event that fires when the user has a page named onunload

.



window.onunload = function() {
    alert("You're leaving this page.");
};

      

0


source


You can create a hidden frame that will add watch to the window.location

main frame object . I'm not sure if you can use the clock in IE - if not, you might just need to poll another window periodically to see which page it is on.

If a user enters an address in a browser window, you cannot capture it (since your frame will be removed), but you will get all the links they click on (even to external sites).

0


source


You can take a look at Fiddler :

... A web debugging tool that allows you to capture, replay and modify HTTP and HTTPS traffic from almost any application.

From what I understand, it acts like a lightweight proxy that can do all sorts of cool things, as defined by the .NET script.

You can also configure it so that you can launch mobile devices through it if that interests you.

0


source







All Articles