Forum Moderators: open
There is no effective way to block access to the source code of any page: for the page to be readable by browsers and search engines, the source code has to be accessible, and so can be copied. That's just how the web works: HTML is sent as a text document and interpreted client-side.
Disabling right-click is little more than an annoyance, and it works sporadically in alternative browsers. Even if you succeed, the View Source option in the menu is always present. The person could also use a download tool such as wget, or even get the page from the Google cache without visiting your site at all.
To answer your question, there is no way to fix it so your source code can't be viewed. It's being downloaded to the visitor's computer, and therefore they can view your source no matter what you do.
You can check out this script [dynamicdrive.com] from DynamicDrive; however, it depends on JavaScript to encrypt your source code and I really don't recommend its use.
It's also not such a good idea to block text selection. There can be very legitimate uses for selecting text for copy-and-paste.
If you're really concerned about people stealing your content, the best thing to do is to put up a copyright notice, then run periodic searches for a few key phrases. If you find someone who's taken your content, you may then be able to get them to remove it, or if they won't, their ISP may shut them down. In extreme cases you might even take them to court, but most of the advice I've heard on that subject is that yu'd be lucky to even recover your costs, much less gain anything by it.
If you put it on the Internet, anyone can take it. You can't stop it; all you can do is go after the ones who infringe on your rights.
Don't use HTML -- it's too vulnerable to being copied.
Simply write your own plugin (look at a plugin like Flash for inspiration).
Talk between the server and the plugin in an encrypted binary format of your own devising.
Yes, of course that would inconvenience many potential users who would have to download your plugin before they could get to the content.
But inconveniencing users appears to be acceptable to you, so that shouldn't be a problem for you with this application.
Although I guess if you combine encryption with being invisible to the bots, that's a pretty winning combo to keep naughty people from nabbing your masterpiece?
^ ^ ^ Amen to that! :-)
Here is how **I** (IMO, my take, opinion only, yada yada) resolve this whole issue in my mind.
Those little tricks to disable right-clicks, etc - they are more of an annoyance than security as previously descibed. You are doing more harm than good by using them. Anyone who wants to steal can get around them.
But let's talk about why I (or you, or anyone) want to prevent content theft in the first place. Obviously it's plagiarism. No argument there. But how many times have you viewed source? "Borrowed" an image? Seen a great effect on a website and used part of it in your own design?
I know there is a great difference between stealing and eclecticism, but the point is that imitation is the greatest form of flattery. If someone's stealing from you, then you have something worth stealing. If that's the case, you also have something worth suing for, and there are many ways to prove it.
So focus on making your content most accessable to your valid visitors (remove those right-click thingies! :-) ) and go after the thieves. or thank them for the compliment, and let them know how sorry for them you are for their lack of creativity to the extent of borrowing yours.