It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Disable "file">"save as" menu. Help!

Disable "file">"save as" menu. Help!

Postby andariel on Sun Feb 24, 2008 12:37 pm

i can disable "file">"save" menu with javascript but i want to disable "save as" menu. i hope someone can show me how to do this.
Thx for everyone helping me...


Here is the JS Code to disable "file">"save" menu;

<script type="text/javascript">
if ('undefined' != typeof document.onselectstart)
{
document.onselectstart = function()
{
return false;
}
}
else
{
document.onmousedown = function()
{
return false;
}
document.onmouseup = function()
{
return true;
}
}
</script>
andariel
 
Posts: 0
Joined: Sun Feb 24, 2008 12:05 pm

Postby leonard on Sun Feb 24, 2008 8:09 pm

1) You are probably talking about IE, because in FF for instance there is no such thing as "File->save".

2) Your code does NOT disable "file -> save" in IE. As far as I know, that is always disabled.

What your script does is it disables the selection (marking) of HTML-objects within your page. But then again, all a webpage-visitor needs to do is to disable JavaScript and all will work again. So if someone wants to select something on your page, he will be able to anyway. Use JavaScript for something more useful (help the user with JS, don't make your page annoying).

i want to disable "save as"
JavaScript cannot influence the menu structure of a user-agent (browser). That would be a real security issue.
Just imagine webpages changing your browser-settings. Your PC would be infected with viruses in an instance.

cheers!
- leonard
:%s/^M//
There are 10 kinds of people:
Those who understand binary and those who don't.
User avatar
leonard
100+ Club
 
Posts: 147
Joined: Tue Dec 18, 2007 7:11 am
Location: Switzerland


Who is online

Users browsing this forum: No registered users and 2 guests