0

Hi
How to hide my source code so to not be viewed?

I think this line of code solve it but where can I put in my source code?

<body oncontextmenu="return false">

</body>

And This is my code

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5</title>
<meta name="description" content="">


<body oncontextmenu="return false">
<style>
body {
    background-image: url(pics/paris.jpg);
    background-position: center top;
    background-size: 105% auto;
}
</style>

</head>



<h3 align="center">Hello World</h3>
</body>

I appreciate your help

6
Contributors
9
Replies
53
Views
3 Years
Discussion Span
Last Post by tdrosiadis
1

You can't. HTML is interpreted by the browser, so it's downloaded no matter what. You can obfuscate it a little, or make it harder for inexperienced users, but it's always viewable.

1

The problem here is that the browser downloads the HTML as pritaeas described. While you can apply techniques to make it more challenging to read, you cannot ultimately prevent someone from getting your HTML code.

I dont even need a browser. There are a variety of other tools as well that can be used to look at the HTTP traffic that was downloaded from the web server.

so, your techniques may make it more chanllenging for those that are not skilled, but not possible for those that have the tools and knowledge to look at the code client side.

1

a possible solution : do the whiz-bang serverside, and only send innocuous html to the browser, php jsp perl instead of javascript.

in your code sample above, line 9 should be line 19.
<body> does not belong inside the <head>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5</title>
<meta name="description" content="">
<style>
body {background: url(pics/paris.jpg) center top; background-size: 105% auto;}
</style>
</head>
<body oncontextmenu="return false">
<h3 align="center">Hello World</h3>
</body>
</html>

Edited by almostbob

0

You can disable the right mouse button to make it difficult of the not-so-advance user to see your code. But that's just a trik!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.