使用javascript阻止导航 [英] Blocking the navigation using javascript

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

问题描述

亲爱的,



我正在尝试为Firefox建立一个阻止导航到某些网站的扩展程序。在IE中,它非常简单,因为我们在导航到任何新URL之前触发了 BEFORENAVIGATE2 事件。但是,在javascript中我们没有这个奢侈的选择。那么,如何在加载页面之前捕获导航到的URL,然后决定是导航到它还是阻止它?!



提前谢谢!

Dear all,

I am trying to build an extension for Firefox which blocks the navigation to certain websites. In IE, its very simple since we have the BEFORENAVIGATE2 event which is fired before the navigation to any new URL. However, in javascript we don''t have this luxurious option. So, how can i catch the URL being navigated to BEFORE the page being loaded, then decide whether to navigate to it or block it?!

Thanks in advance!

推荐答案

我搜索了 beforenavigate2 firefox [ ^ ]和 [ ^ ]是第一个结果。我想这就是你要找的东西。
I searched for beforenavigate2 firefox[^] and this[^] was the first result. I guess it''s what your are looking for.


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

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