Prevent view source

Discussion in 'HTML & Website Design' started by Cinta April, Apr 17, 2008.

  1. #1
    Hi how do I prevent people from viewing my html source in IE 7? What if they had another browser?
     
    Cinta April, Apr 17, 2008 IP
  2. $earner

    $earner Well-Known Member

    Messages:
    162
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #2
    I don't think you can prevent your users from viewing the source code of your site, as it is the document that browsers use to render the page. So, if the page is fully viewable to the user, the source code is fully accessible.
     
    $earner, Apr 17, 2008 IP
  3. BMD-Media

    BMD-Media Active Member

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #3
    There are tricks you could do such as a "0" frame. An easy way is to install a No Right-Click script
     
    BMD-Media, Apr 17, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Those tricks are so easliy gotten around (View Frame Source in FF, or simply disable all Javascript and now you can right-click again) that all they are good for is bloating your page.

    To the OP: Just be very careful not to put anything online that you don't want people to see. As $earner said, anything you want a browser to show means the browser needs access to it. If the browser has access, the person using the browser does too. It's just the way it is. There are tons of scripts out there to hide stuff from people. They are all easily disabled because all one has to do is disable scripts. Period.

    For images, the best you can do is watermarking and having the online version a slightly crappier resolution while the good version stays offline. Those of us who are good at image-editing software can still usually remove watermarks if we want to put the work into it, but that's about the best you can do.

    Remember, everything you put online is PUBLIC. That's just how teh Interwebz works.
     
    Stomme poes, Apr 18, 2008 IP
  5. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #5
    You can do it using javascript , however user can always disable javascript and view source , rather encrypt the page and use javascript.write("....") .
     
    it career, Apr 18, 2008 IP
  6. tyler3

    tyler3 Peon

    Messages:
    270
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6

    like stomme said...if they have access to it in their browser they can read the source...there isn't much you can do about it. What's in your source that you don't want people being able to see? maybe someone could help if they had a direction to start looking in?
     
    tyler3, Apr 18, 2008 IP
  7. astarwebdesigns

    astarwebdesigns Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    view source is a completely client side command - only way to stop it is scripts, which can be turned off...
    i suggest just writing "copying any part of this website is against our terms and conditions" in a pop-up window when someone right clicks, won't stop them but will be a big bonus if your taking someone to court for copyrighting
     
    astarwebdesigns, Apr 18, 2008 IP
  8. vidal

    vidal Well-Known Member

    Messages:
    186
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    145
    #8
    vidal, Apr 21, 2008 IP
  9. FUNNYBIRD

    FUNNYBIRD Peon

    Messages:
    76
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    nope, no-right click also does not help , The source can still be viewed .:D
     
    FUNNYBIRD, Apr 21, 2008 IP
  10. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The question is, why do you want to?

    Even if you could stop people seeing the source code then people can just take a screenshot and write their own HTML to make the identical page and nick the graphics from the screenshot.

    If you are trying to stop people seeing a formula for a calculation or such then the real option is to put that formula serverside and use a postback rather than doing it client side - hides your calculations but increases traffic/ response time - up to you which is more important.
     
    AstarothSolutions, Apr 21, 2008 IP
  11. real_skinner

    real_skinner Notable Member

    Messages:
    2,400
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    215
    #11
    There won't be a way.... but if you found one let me know......
     
    real_skinner, Apr 21, 2008 IP