Source Code hiding?

  • 1
  • Question
  • Updated 8 years ago
  • Answered
Hello Yola community,

I'm working on a website that needs to have the source code hidden from:
a. right click, view page source;
b. View-->Page Source;
c. Ctrl + U;
or any other ways possible.

Is there a way to do this, with html and/or Javascript?

(I'm not very good with either, and I'm not sure how to even use Javascript in the HTML editor.)
Photo of fangda.zheng

fangda.zheng

  • 4 Posts
  • 0 Reply Likes
  • frustrated

Posted 8 years ago

  • 1
Photo of Emmy

Emmy

  • 5892 Posts
  • 299 Reply Likes
Hello,
This question often gets asked in regards to disabling right click in order to keep people from downloading images, but it would solve what you are wanting to do as well.

We have a detailed answer here on the forum about this: How to stop people right clicking.

I hope this information is helpful!

Emmy
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Hi fangda.zheng,

Unfortunately blocking the right click will not stop people getting your source code. They can use either of the other 2 methods you mention above, plus a handful of others.

The point is that you can not hide the source code of a page. Nor is there any real reason why you would want or need to hide it.

If you leave the reason why you want to hide it we could maybe come up with a good workaround or solution.

Lee.
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
The reason fangda.zheng would like to hide the source code is because people can go into the code, and then copy it and take all the work you've done. I wish all the borwsers had a feature so some websites can use a code to disable the view source!
Photo of fangda.zheng

fangda.zheng

  • 4 Posts
  • 0 Reply Likes
First of all, I'd like to give a perfect example of what I'm talking about:
platformracing3.co.cc
No matter how you try to view the source, it's impossible, from any of the 3 methods mentioned.

I have no need to hide images, but I want to hide a little embed flash thing:
src="blah".

If you like the full code (it's long), I may give it to you.

I noticed something called ByteRun HTML Protector. It seems to work like a charm.
Perhaps I could download my website, use the program on it, then upload it elsewhere?

:S I really want to continue to use Yola, but that seems impossible for the desired effect.
-- unless you can help.

DFZ
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello fangda.zheng

Unfortunately, the ByteRun HTML Protector program appears to need PHP programming which is not possible with Yola.

I'm sorry that I don't have better news for you.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Hello,

I have learned something from this thread. Did not know that was possible, I guess if your product lives in a file then it is worth while trying to protect it.

The website you mention above (platformracing3.co.cc) actually uses some kind of javascript encryption method - If you go to their home page and 'save page as' then view the source of that html doc, scroll down and you will see the source code.

You can use javascript with Yola so I would look at that first -- If you google 'source code encryption javascript' you will see loads of results, look through them see if any will work for you.

This is a basic encrypter http://www.iwebtool.com/html_encrypter after that you will need to learn how to block all the methods of retrieving source code that you mention in your first post.

Good luck, Hope you can continue using Yola.

Lee.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Great detective work, Lee! Thanks!
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
You can also view the source code by going to Page>View Source and it says "No source code available" but really if you scroll down its there! And they use javascript for the "No copying" alert and the no text select. They are trying to make their site secure!
Photo of fangda.zheng

fangda.zheng

  • 4 Posts
  • 0 Reply Likes
Okay, that seems to help a lot.
You can simply transfer the encrypted HTML to the html editor. It seems to work.
One last thing: Is it decodable?
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Yeah, if someone knows how to decode they can decode it unless it is a special tracking thing and you can track who has your code!
Photo of fangda.zheng

fangda.zheng

  • 4 Posts
  • 0 Reply Likes
Thanks for the help, I have given up on trying to do this. D:
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
If we could edit the source code of our Yola sites, we could put all of our source code all the way at the bottom and make it look like theres no scroll bar. And then at the top put "<!--No soucre code available--><!--Copyright © 2010 yourwebsite All Rights Reserved-->