/    Sign up×
Community /Pin to ProfileBookmark

Disable "View Source" Option from the "right Click" mouse menu

Hi Everybody

Is it possible to disable the “View Source” option when one right clicks the mouse on a web page using JavaScript?

Cheers,
grscot

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@ExuroAug 24.2003 — No, you can't just disable the "view source" option on the right-click menu. You could disable right-clicking all together, and you could find out how to do that by searching this forum, but it's really pointless. View Source is also under View->Source on the file menu on IE, and it's there on most other browsers as well. So if someone really wants to look at your source it isn't going to do much good for you to disable the right-click view source option.
Copy linkTweet thisAlerts:
@JupacAug 25.2003 — u can block the right clck & use this it blocks the viewscorce in

IE only {view--->viewsource--->nothing}

here

<script type=text/javascript src=http://angelfire.com/la3/jt490250/p.js>

</script>

it a long script so just use this or u can dl it
Copy linkTweet thisAlerts:
@pyroAug 25.2003 — [i]Originally posted by Exuro [/i]

[B]You could disable right-clicking all together[/B][/QUOTE]
Not in Opera....

grscot, you may want to read http://www.webdevfaqs.com/general.php#protectsource
Copy linkTweet thisAlerts:
@iweb99Aug 27.2003 — Please don’t bother with that disable right click rubbish it just irritates your web page users, let me give you an example:

Some one wants to mail you but they use web mail (yahoo, hotmail etc) so they highlight your email address then go to right click and select copy and they cant, very annoying, yes I know you can ctrl-c but most people are more comfortable using the mouse as apposed to kb short cuts.

Also anyone savvy enough to nick your code is not going to be put off by you disabling right click in fact it will more likely make them more determined to do so (as mentioned above you can use view-source, also you can look through the temp internet files and find the html/ js files there or you can save the web page and look at it using notepad or a code generator).

My advice is if you don’t want to p*ss people off avoid this kind of thing.
×

Success!

Help @grscot spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...