简体   繁体   English

禁用IE并调整其大小

[英]Disable & resize IE

I have a few questions in mind... 我有几个问题在想...

  1. I want to disable right click on my webpage so that noone can alter the source code 我想禁用我的网页上的右键单击,以便没有人可以更改源代码
  2. I want to disable the addressBar as well 我也想禁用addressBar
  3. I wish to resize it to a particular size in the bottom right of my screen & with a text area so that when ever I click the button inside that webpage all the contents in that text box should be copied 我希望将其调整为屏幕右下角并带有文本区域的特定大小,以便每当我单击该网页内的按钮时,都应复制该文本框中的所有内容

I tried experimenting but it doesn't seem to work, javascript maybe has some issues. 我尝试进行实验,但似乎无法正常工作,javascript可能存在一些问题。 I wan't it purely on javascript & HTML (Can't use php/asp), want it to work on IE only, dont care about other browsers.... 我只想在javascript和HTML上使用它(不能使用php / asp),只希望它在IE上运行,不关心其他浏览器。

1) I wasnt to dis able right click on my webpage so that no one can alter the source code 1)我没有禁止右键单击我的网页,以便没有人可以更改源代码

Regardless of browser hackery employed, the user will always be able to view your source. 无论使用何种浏览器黑客,用户都将始终能够查看您的源。 Nobody will ever be able to alter the source code on your server (short of the server being hacked or a vulnerability in your code is found). 任何人无法更改服务器上的源代码(除非服务器被黑客入侵或在您的代码中发现漏洞)。 But, using Firebug (or similar), anyone can change client-side script, CSS and/or HTML. 但是,使用Firebug(或类似工具),任何人都可以更改客户端脚本,CSS和/或HTML。

2)I want to disable the addressBar as well 2)我也想禁用addressBar

You can't just gain full access of a browser. 您不能仅仅获得浏览器的完全访问权限。 That would get annoying pretty quickly (think about the potential browser-inducing epilepsy if every site had control over your root browser and did different things to it). 那样很快就会很烦人(想想如果每个站点都可以控制您的根浏览器并对它执行不同的操作,就可能引起浏览器癫痫发作)。 One thing that you could do is have your site create a popup window that is set to a specific size with specific attributes (hiding the address bar, etc). 可以做的一件事是让您的站点创建一个弹出窗口,该窗口设置为具有特定属性(隐藏地址栏等)的特定大小。 Note that you may annoy users with this as you'll have to deal with popup blockers and such. 请注意,您可能会因此而烦恼用户,因为您必须处理弹出窗口阻止程序等。

3)I wish to resize it to a particular size in the bottom right of my screen & with a text area so that when ever I click the button inside that webpage all the contents in that text box should be copied 3)我希望将其调整为屏幕右下角并带有文本区域的特定大小,以便每当我单击该网页内的按钮时,都应复制该文本框中的所有内容

I have no idea what this means. 我不知道这是什么意思。


Was this post a troll? 这个帖子是巨魔吗?

You can't disable the address bar with JavaScript. 您无法使用JavaScript禁用地址栏。

However you can disable right click. 但是,您可以禁用右键单击。 Note: Anyone with enough technical background to know what to do with the source code would know enough to just disable JavaScript to get their right click working. 注意:具有足够的技术背景并知道如何处理源代码的任何人都将足以禁用JavaScript以使其右键单击起作用。

Here's a demo with source code to disable right click. 这是一个带有禁用右键单击功能的源代码的演示。

Demian's answer has some good insight on what you're asking, I strongly suggest you rethink what you're doing. Demian的答案对您的要求有很好的了解,我强烈建议您重新考虑您在做什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM