locked link on HTML page

Out of possibly misplaced fear, I have been locking my websites against right-click (HTMLGuard works pretty well unless a very basic browser is used). On one page (URL below), I have a link to a file with the statistics, which can be clicked and opened, which is what I want. The thing is that the back button then doesn't work so visitors can't return to that page immediately.

While I could just leave out that page from the guarding process, I am hoping that something else even better may be suggested (other than not preventing right-clicking in the first place!).


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
Well, of course that I have to make this question:
What are the motivations behind (apparently) locking the page in the first place?

This locking mechanism gives you an apparent sense of security.
I can still perfectly see the source of your page and inspect it with the browser dev tools.
So, if a user is "smart" enough to know about page source and dev tools, it's not this (or any) trick that will prevent him to do so.

Bottom line, whatever problem you're having, dropping this so called "lock" mechanism is the best option.

jonesseTreasurerAuthor Commented:

Thank you very much, especially for the speed. It is fine if people can see the source so long as they can't change it easily; I know it won't be impossible. So protection has a role to play.

Julian HansenCommented:
1. Why are you protecting against right click - there is nothing on your page I cannot see despite your HTMLGuard in place?

2. Why are you not specifying that the PDF open in a new window with the target="_blank" attribute?

3. Even with the code as is I am able to hit the back button from the PDF and get to your page.

Other comments

You are using tables for layout which is not what tables are meant for - it works but it is not in line with html coding standards.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
>Out of possibly misplaced fear

Yes, that is misplaced fear.  Not only can it be disabled and worked around, it creates a horrendous user experience.  If I can't right click, I typically just leave the site.

All you need to do is use the browser console to grab the code and text
Julian HansenCommented:
It is fine if people can see the source so long as they can't change it easily
I am confused - anyone can change a page once it is in the browser - why are you trying to stop this?

See embedded image showing change
Julian HansenCommented:
And, if I really wanted your content - I could write a couple of lines of server script and cURL / wget / or number of other methods to simply download the content, strip out the tags, save the images etc.

Basically if it is visible in a browser it is open source and preventing the right click has zero benefit to you and is extremely annoying to users. As Scott said above - if I find a site that does this I go somewhere else.
Alexandre SimõesManager / Technology SpecialistCommented:
It is fine if people can see the source so long as they can't change it easily
I understand that you're trying to prevent the user from hitting "copy" from the context  menu but above you have a pretty good amount of examples showing how useless this is.

With this you'll probably scare people away other than make them came back.

If the content is good (I have no judgement on that), invest in a better layout, make it more pleasant, and even if people use your information (copy/paste), I'm sure most will be pleased to reference your site so that others can also use it.
On the other hand, if they're not planning to give you credit for the content, it's not this "trick" that will prevent them :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jonesseTreasurerAuthor Commented:
Thank you, all, my back button did not get me back to the page. The protection will be disappearing very soon!

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If seo is a factor, notice that page is invisible because of the obfuscation.  Google the following search term -


Notice that page does not show up.

If you want your blog to get noticed, making it easier to view in both desktop and mobile is key. As Julian pointed out your method of using tables for layouts is far from optimal as is using clear gif's.  That was done in the 90's.

Make it easy on yourself so you only have to worry about your writing, convert to a cms like wodpress.com if you want it hosted or .org if you want to host.  But the likes of wix/weebly/squarespace are all in one hosted and much easier to use.  Just pick out a theme and only worry about your content. The themes are all responsive so they will look good on mobile and desktop.

Best of luck on your site.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.