如何在Web浏览器中禁用新选项卡..? [英] how to disable new tab in web browser..?

查看:82
本文介绍了如何在Web浏览器中禁用新选项卡..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script language=JavaScript>




        var message = "disable right click";

        ///////////////////////////////////
        function clickIE4() {
            if (event.button == 2) {
                alert(message);
                return false;
            }
        }

        function clickNS4(e) {
            if (document.layers || document.getElementById && !document.all) {
                if (e.which == 2 || e.which == 3) {
                    alert(message);
                    return false;
                }
            }
        }

        if (document.layers) {
            document.captureEvents(Event.MOUSEDOWN);
            document.onmousedown = clickNS4;
        }
        else if (document.all && !document.getElementById) {
            document.onmousedown = clickIE4;
        }

        document.oncontextmenu = new Function("alert(message);return false")


</script>











但是当我按下控制键+右键单击新选项卡打开时,这是






but when i press control+right click new tab open is any solution for this

推荐答案

唯一正确和正确的方法是在每个浏览器中创建扩展,并且仅当浏览器支持此功能时。你使用的任何其他方法都是黑客攻击,并且有办法绕过它们。
The only proper and correct way is create an extension in each browser and only if the browser supports this feature. Any other methods you use will be hacks and will have ways of getting around them.


这篇关于如何在Web浏览器中禁用新选项卡..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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