简体   繁体   中英

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
  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. 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....

1) I wasnt to dis able right click on my webpage so that no one can alter the source code

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.

2)I want to disable the addressBar as well

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

I have no idea what this means.


Was this post a troll?

You can't disable the address bar with 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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