SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Prevent View Scoure

    It seems as if this would be impossible, but does anyone know if there is a way one can prevent visitors from viewing the source of a page?

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Yes. Keep it saved on a floppy disk, locked in your own safe. And nowhere else.

    It is not possible in any way, shape or form to prevent people from viewing the source code. Their computer has to download it in order to show the page, and once it's done that, there is nothing you can do that will stop them from viewing the source code if that's what they want to do.

  3. #3
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I heard rumours it is possible, if you pull the plug on your hosting server.

    But with today's Google's cached pages, you can never know.



    Other suggestions:

    - hide it in plain site (sight, site, get it...?)

    - code your page so smart no one will ever be able to understand it (on a second thought, others have tried the dumb coding road pretty successful)

    - make a request to W3C and/or WHATWG to also allow mark up be written in cuneiform (WHATWG may seem more inclined to approve this)


    I feel ashamed and stupid for posting the above suggestions, but the question kind of asked it. My apologies team1504. Please look at it like it's a circumstantial joke, as it is.

    This question has been asked before, over and over. What is it with people first suckling up FREE knowledge from others (and their web pages) like a sponge and then trying to conceal what they've learned rather than passing it further on?

    Think of this: Microsoft, Apple, Adobe and all the software producers CAN'T find a way to stop their products from being pirated. Do you believe you have something similar in size, complexity, software intelligence, that will make it worth you hiding some html mark up?

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The typical answer is digging a hole in the garden to bury it... but if you allow the page to be viewable by the public they'll be able to access you markup.

    There are ways to slow people that only have a little or basic web knowledge but if it's just static markup in plain sight on a site forget trying to hide it as it won't work.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,819
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Any attempt to block viewing the source (such as encrypting the page source) can be easily bypassed since encrypted HTML can be easily decrypted with a web browser and two lines of JavaScript. Encrypting the page also stops anyone without JavaScript from accessing it.

    Whatever you do to try to "protect" your page will lose you a lot of legitimate visitors AND make it more likely that those you are trying to block will actually bypass your block just because they think it is somehow clever that they know how.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •