₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,335 members, 8,511,332 topics. Date: Sunday, 01 November 2026 at 11:32 AM

Toggle theme

Challenge! You Cant View This Page Source Code! - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Challenge! You Cant View This Page Source Code! (1448 Views)

1 Reply (Go Down)

Challenge! You Cant View This Page Source Code! by uvalued(op): 9:30am On Jun 08, 2015
Greetings, i was surfing and doing some javascript search and i came across a post that shows how a page deny you accessing the "view source" option on the context menu and after some seconds it self destruct.

i was wondering how did the developer grayed out the "view source" option under the right click context menu?


This is the link.

http://devrijehuisarts.org/test/noViewSource.asp

Re: Challenge! You Cant View This Page Source Code! by fattbabakay(m): 10:30am On Jun 08, 2015
Just google "How to hide my website's source page" ...You should get a means.
Re: Challenge! You Cant View This Page Source Code! by uvalued(op): 1:30pm On Jun 08, 2015
fattbabakay:
Just google "How to hide my website's source page" ...You should get a means.
Thanks! I have googled it but most comments were its not POSSIBLE. And this link shows that its possible!
Re: Challenge! You Cant View This Page Source Code! by Craigston: 4:03pm On Jun 08, 2015
<html><head><link rel="stylesheet"
media="screen,projection,tv,handheld"
href="opera:style/image.css"><style media
="(max-width:816px),(max-height:516px)
"> body.contain {position: absolute;margin:
0;top: 0;left: 0;bottom: 0;right: 0;}
body.contain > img {width: 100%;height:
100%;-o-object-fit: contain;cursor: zoom-in;}
body.zoom > img {cursor: zoom-out;} </
style><link rel="icon"
href=""><title> noViewSource.asp (800×500)
</title></head><body
class="contain"><img
onerror="this.error=true" src=""><script>
(function() {if (window.donotrun)return;var
img = document.querySelector('img')
;document.title =
window.location.pathname.match(/([^\/]*)
\/*$/)[1];var zoomX;var zoomY;function
zoomIn() {document.body.className =
'zoom';window.scrollTo(zoomX +
img.offsetLeft -
window.innerWidth/2,zoomY +
img.offsetTop - window.innerHeight/2);}
function zoomOut() {zoomX =
window.scrollX + window.innerWidth/2 -
img.offsetLeft;zoomY = window.scrollY +
window.innerHeight/2 -
img.offsetTop;document.body.className =
'contain';}var interval = setInterval(function
() {if (img.naturalWidth &&
img.naturalHeight) {clearInterval(interval)
;document.title += ' ('+img.naturalWidth
+'\u00d7'+img.naturalHeight+')';var
padding = 2*parseInt(getComputedStyle
(document.body).padding, 10);var s =
document.querySelector('style[media]')
;s.media = '(max-width:' +
(img.naturalWidth + padding) + 'px),(max-
height:' + (img.naturalHeight + padding) +
'px)';zoomX = img.naturalWidth/2;zoomY =
img.naturalHeight/2;} else if (img.error)
{clearInterval(interval);}}, 100);function
modKey(e) { return e.altKey || e.ctrlKey ||
e.metaKey || e.shiftKey; }img.onclick =
function(e) {if (e.button == 0 && !modKey(e)
) {var s = getComputedStyle(img);if
(s.cursor == 'zoom-in') {zoomX =
e.offsetX;zoomY = e.offsetY;var clientAspect
= img.clientWidth/img.clientHeight;var
naturalAspect = img.naturalWidth/
img.naturalHeight;var scale;if
(naturalAspect > clientAspect) {var
displayHeight = img.clientWidth/
naturalAspect;zoomY -= (img.clientHeight -
displayHeight)/2;scale = img.clientWidth/
img.naturalWidth;} else {var displayWidth =
img.clientHeight*naturalAspect;zoomX -=
(img.clientWidth - displayWidth)/2;scale =
img.clientHeight/img.naturalHeight;}
zoomX /= scale;zoomY /= scale;zoomIn();}
else if (s.cursor == 'zoom-out') {zoomOut();}}
};window.onkeypress = function(e) {if
(e.keyCode == 13 && !modKey(e)) {var s =
getComputedStyle(img);if (s.cursor ==
'zoom-in')zoomIn();else if (s.cursor ==
'zoom-out')zoomOut();e.preventDefault();}}
;var drag;window.ondragstart = function(e)
{if (document.body.className == 'zoom')
e.preventDefault();};window.onmousedown
= function(e) {if (e.button == 0 && !modKey
(e) && document.body.className ==
'zoom')drag = {screenX: e.screenX,screenY:
e.screenY,scrollX: window.scrollX,scrollY:
window.scrollY};};window.onmouseup =
function(e) {img.style.cursor = '';drag =
undefined;};window.onmousemove =
function(e) {if (!drag)
return;img.style.cursor =
'move';window.scrollTo(drag.scrollX +
drag.screenX - e.screenX,drag.scrollY +
drag.screenY - e.screenY);};})(); </script></
body></html>
I couldn't find the page, how then the source. Where's the page? That's an image.
Re: Challenge! You Cant View This Page Source Code! by seunthomas: 10:07pm On Jun 09, 2015
LOL. its not so difficult, what they did is regenerate an image every few secounds. The page itself is an image. If you examing the code using developer console, you will see that the server is just spitting out jpeg file. Basically your page is just generating an image.
Re: Challenge! You Cant View This Page Source Code! by uvalued(op): 2:48pm On Jun 10, 2015
Craigston:
I couldn't find the page, how then the source. Where's the page? That's an image.
LOL. its not so difficult, what they did is regenerate an image every few secounds. The page itself is an image. If you examing the code using developer console, you will see that the server is just spitting out jpeg file. Basically your page is just generating an image.
http://devrijehuisarts.org/test/noViewSource.asp

thats the source. yes it looks like an image. What am interested in, did you right click and see "VIEW SOURCE"? That is what am interested in. How did the developer grayed out the "VIEW SOURCE" option when you right click?
Re: Challenge! You Cant View This Page Source Code! by AAinEqGuinea: 4:43pm On Jun 10, 2015
uvalued:
http://devrijehuisarts.org/test/noViewSource.asp

thats the source. yes it looks like an image. What am interested in, did you right click and see "VIEW SOURCE"? That is what am interested in. How did the developer grayed out the "VIEW SOURCE" option when you right click?
Peeking breaks it

Re: Challenge! You Cant View This Page Source Code! by seunthomas: 7:05pm On Jun 10, 2015
Its simple again. You cant view source for an image. The developer did not gray out anything.
1 Reply

Online Banking Source Code In PHP, MSQL • Need Step On How To Hide Javascript Source Code. • [source Code] A Program That Solves A Transportation Problem - By Frank UMEADI • 2 • 3 • 4

Want To Convert Vb.net App To Android • My Harddisk Got Corrupted.I Need Help Recovering My Files.kindly Help • What OS Are You Using On Your System