导航前拦截URL [英] Intercepting URL before navigation

查看:96
本文介绍了导航前拦截URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拦截用户在浏览器中输入的所有URL并执行一些任务,然后再继续进行导航(任何方式都可以,即插即用,通过代理或任何其他创造性建议)。
需要说明的是-我不是指需要捕获此信息的特定应用程序,而是-捕获用户在其浏览器上执行的任何导航(即用户未打开我的应用程序,应该在后台运行或类似的东西...)
预先感谢...

I would like to intercept any URL which the user enters in their browser and perform some tasks before allowing the navigation to continue (any way could be good - i.e. via plug in, via proxy or any other creative suggestion). To clarify - I am not referring to a specific application that needs to catch this, but rather - any navigation that the user does on his browser needs to be caught (i.e. the user is not opening my application, it should be running in the background or something like that...) Thanks in advance...

推荐答案

我不认为您可以拦截用户通过javascript输入的内容。它闻起来像一个巨大的安全漏洞。您可以检测到用户何时离开页面,但是无法检测到用户下一步要去哪里。

I do not think you can "intercept" what the user enters via javascript. It smells like a big security exploit. You can detect when the user leaves the page, but you cannot detect where he is going next.


  • 代理是一个很好的选择选择是否只需要处理URL字符串。但是,任何更复杂的事情在代理中实现都会很复杂。

  • A proxy is a good choice if you just need the URL string to be processed. But anything more complex will be complicated to implement in a proxy.

但是,一个插件取决于您要定位的浏览器,因此您无法制作一个插件定位到所有浏览器并同时控制用户导航的插件。但是,如果您要选择用户使用的浏览器,那么也许可以。

A plugin however, depends on which browser you are targetting, you can't make a single plugin that targets all browser and control user navigation at the same time. But if you get to selects which browser your user uses, then maybe.

如何滚动自己的浏览器(使用IE的ActiveX控件)或使用其中一种

How about rolling your own browser (using IE's ActiveX control) or using one of the open source alternatives and use that?

您希望执行什么处理?

这篇关于导航前拦截URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆