1

I wanna show some text (and images) in browser but this text shouldn't be able to select in page preview or page source :

  1. At first i tried to use canvas, but managing text and also images in canvas is not easy and for this case i can't use canvas.

  2. I tried to use image but in this case, image is too slow to load.

  3. I used ROT13 encryption in Aptana studio, but ROT13 just encrypt page source with JS and when you click on 'inspect element' in chrome or opera you can see decrypt text and html yet.

Question: Is there any way in jquery or anything else?

getty
  • 135
  • 11
Mehdi Hosseini
  • 1,937
  • 1
  • 18
  • 29
  • 4
    Even if there was, you're still showing the text to the user in the first place. Nothing's stopping him to take a screenshot of the page and run an OCR tool on the result later. So, I don't think what you want can be achieved in a general way. – Frédéric Hamidi Feb 02 '12 at 08:56
  • I guess people manage the scenario of sensitive images and text through some kind of authentication/authorisation model - could this be ultimately what you want to go towards? Just a thought – Crab Bucket Feb 02 '12 at 08:59
  • it's not problem for take a screentshot or use OCRs, just i want normal users can't see text. – Mehdi Hosseini Feb 02 '12 at 09:00
  • yeah, crab, thats it, have you any idea? – Mehdi Hosseini Feb 02 '12 at 09:04
  • What are you trying to hide? Perhaps there is some lateral thinking that could help. – Dan Blows Feb 02 '12 at 09:04
  • i'm trying to hide text like google books. we see the book, but we can't see data in html source code. – Mehdi Hosseini Feb 02 '12 at 09:13
  • the closest you could get using html is using canvas. however, if the text can still be intercepted elsewhere like in the script that writes the canvas, or if ajax, intercept the request. html is like plain as day. google books either use PDFs or images. like they say, a determined person can always find ways. – Joseph Feb 02 '12 at 09:22

5 Answers5

1

No, whatever you display as text in webpage can be found by digging into the source of the webpage (including js). What would this be useful for btw.?

Edit: This looks useful but ends up using canvas or flash I believe. Still might be tuned to be fairly fast and therefor useful:

http://eric-blue.com/2010/01/03/how-to-create-your-own-personal-document-viewer-like-scribd-or-google-books/

Jan Zyka
  • 17,460
  • 16
  • 70
  • 118
  • in js i can encrypt js, but when i want show text with js, in google chrome inspect element all the data is decrypt. – Mehdi Hosseini Feb 02 '12 at 09:08
  • My point is, if someone will want to copy a text displayed on the webpage he will find a way and you can't really do much about it. Could you share the purpose of trying to hide that text? Can't imagine anything reasonable – Jan Zyka Feb 02 '12 at 09:17
  • Of course unless you use some sort of graphics like flash, canvas, pictures etc. but I understood this is not acceptable for you. – Jan Zyka Feb 02 '12 at 09:18
  • i see google books, and i try to select a text in page source but there is no text in page source, and parsing the google's code on that page was very hard for me. – Mehdi Hosseini Feb 02 '12 at 09:22
  • 1
    This seems like a useful resource. But I believe it all ends up on a canvas or flash. http://eric-blue.com/2010/01/03/how-to-create-your-own-personal-document-viewer-like-scribd-or-google-books/ – Jan Zyka Feb 02 '12 at 09:37
0

You most likely won't find a way to do this easily, as when the browser downloads the page, in order to show the text to the user it has to be decoded or decrypted. So no matter what, if the user can see it, they can copy it. If all you want is to block selection in the browser, this answer should help

Community
  • 1
  • 1
annonymously
  • 4,708
  • 6
  • 33
  • 47
0

No, if you want to place something on the page a browser need to know what you want to place on the page. And everything what was sent to the browser is readable for a user. So you cannot do this.

The answer is very simple: If you don't want to publish something don't place it on the internet.

Wouter J
  • 41,455
  • 15
  • 107
  • 112
0

yes, this my logic check out

make you string in ascii code and write on document check below link and find example may you help Link W3School

Ankur Loriya
  • 3,276
  • 8
  • 31
  • 58
-1

I guess no one could do that. Just use some image instead, old-style, but useful.

shawjia
  • 1,707
  • 3
  • 13
  • 11