Skip to content

Instantly share code, notes, and snippets.

@rayantony
Last active November 2, 2017 23:51
Show Gist options
  • Save rayantony/abd5be8ba6e7bd498cd6ba97c7ff4918 to your computer and use it in GitHub Desktop.
Save rayantony/abd5be8ba6e7bd498cd6ba97c7ff4918 to your computer and use it in GitHub Desktop.
Page Info πŸ” JS Bookmarklet

Page Info πŸ” JS Bookmarklet

summary:

lightweight dependency free simul-display of current page info to both the console and alert box, including a quine (program that produces as output...itself)

usage:

paste in address bar and hit enter, or save as bookmark on your toolbar make sure it starts with javascript: name it whatever you want. easy!

2 variations, but virtually the same

βž• ver 1

javascript:!function $(){var bs='\n',p='origin: '+window.location.origin+bs,a='title: '+document.title+bs,g='href: '+location.href+bs,e='hash: '+location.hash+bs,i='agent: '+navigator.appVersion+bs,n='last mod: '+document.lastModified+bs,f='current: '+Date()+bs+bs,o='javascript: '+bs+'!'+$+'()',str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);}()

βž• ver 2

javascript:(function $(){var bs='\n',p='origin: '+window.location.origin +bs,a='title: '+document.title +bs,g='href: '+location.href +bs,e='hash: '+location.hash +bs,i='agent: '+navigator.appVersion +bs,n='last mod: '+document.lastModified +bs,f='current: '+Date() +bs+bs,o='javascript: '+bs+'('+$+')()';var str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);})()

notes:

made in this ephemeral uri page, because I got tired of coding in the address bar. but only after this uri page, was rewritten for this instance, recursively within itself, for the same reasons then copied to github hence this is here, not there. It happens...

why?:

sigh, compulsion i guess. signed up for a service, got distracted, tried some exploits (no ill intent) just feeling the walls you know, found something right away, but the url was too long for screenshot so this was to capture pertinent info for me, or the developers of the app/site via a message box/console summary if I decide to send it to them or if the authorities need context during the routine questioning of potential witnesses and surveying of open tabs on my screen at the time of my untimely and figurative ⚰ death, the circumstances are disputed exagerrations of a rumour 2 years ago all certainly suspicious.

@Paul isn't dead either fyi. And big surprise right, @ringo is blatantly still spreading this nonsense its fake fab four news!

Did you? Send them a notice or file a report?:

nope. Deeming it non critical at a glance, I elected to say nothing but considered other factors which are, well I'm secretive and if its all the same a door open for me is better than not. But everything from the wannabees in poor countries with elaborate schemes to smash a penny into 3 pennies divided by 20 people the acknowledgement of anything by anyone real, is a citation to boost ranking by small margin, thus traffic and ad revenue. a growing population of geeks with distorted value perceptions of work ethic, privacy, entitlement, has a generation volunteering away that which they should not, including their time and copyrights, obsessed with $50 bounties, github numbers, thank you tweets, lame contributions, obvious insights with cliche titles for maximum penetration to the douchiest demographic, referring to every hello world they cut & paste as a hack...

If there were less tattlers assuming the role of hall monitor as adults because they're petty dicks, the Internet would be fun again. Instead of the intricate web of deceit, arrogance, idiocy, betrayal, and misplaced ideals, misunderstood things, manipulation, cliches, and double talking fake altruism exploiting douchebag tax evading conglomerates who in a day, can file a patent, make a billion dollars, rant about info and software inherently belonging to the masses,influence legislation in every country, buy any study to say anything, dine with the president, topple x vertical a'la Microsoft, get crowned smartest most awesome richest thinker driving it all forward and still make it back in time to send employees into the streets for black gay muslims h501 visa rights on account of their genius potential and forthcoming inevitable breakthrough contributions and coincidental modest paycheck demands...you get it right?

:shipit: @deadflowers,@rkooyenga

2 variations virtually the same friendly formatted β˜‘

(copy and paste to address bar or drag to bookmark bar. You must copy the javascript: too it is important and browsers may clip it off when pasting...if that happens just retype it, no http:// or https:// nec.)

βž• ver 1:

javascript:!function $(){var bs='\n',p='origin: '+window.location.origin+bs,a='title: '+document.title 
+bs,g='href: '+ location.href+bs,e='hash: '+location.hash+bs,i='agent: '+navigator.appVersion 
+bs,n='last mod: '+document.lastModified+bs,f='current: '+Date() +bs+bs,o='javascript: '
+bs+'!'+$+'()',str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);}()

βž• ver 2:

javascript:(function $(){var bs='\n',p='origin: '+window.location.origin +bs,a='title: '+document.title 
+bs,g='href: '+location.href +bs,e='hash: '+location.hash +bs,i='agent: '+navigator.appVersion 
+bs,n='last mod: '+document.lastModified +bs,f='current: '+Date() +bs+bs,o='javascript: ' 
+bs+'('+$+')()';var str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);})()

*contains trivial alterations for syntax readability :shipit: @deadflowers, @r.kooyenga

javascript:!function $(){var bs='\n',p='origin: '+window.location.origin+bs,a='title: '+document.title+bs,g='href: '+location.href+bs,e='hash: '+location.hash+bs,i='agent: '+navigator.appVersion+bs,n='last mod: '+document.lastModified+bs,f='current: '+Date()+bs+bs,o='javascript: '+bs+'!'+$+'()',str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);}()
!function $(){var bs='\n',p='origin: '+window.location.origin+bs,a='title: '+document.title+bs,g='href: '+location.href+bs,e='hash: '+location.hash+bs,i='agent: '+navigator.appVersion+bs,n='last mod: '+document.lastModified+bs,f='current: '+Date()+bs+bs,o='javascript: '+bs+'!'+$+'()',str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);}()
javascript:(function $(){var bs='\n',p='origin: '+window.location.origin +bs,a='title: '+document.title +bs,g='href: '+location.href +bs,e='hash: '+location.hash +bs,i='agent: '+navigator.appVersion +bs,n='last mod: '+document.lastModified +bs,f='current: '+Date() +bs+bs,o='javascript: '+bs+'('+$+')()';var str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);})()
(function $(){var bs='\n',p='origin: '+window.location.origin +bs,a='title: '+document.title +bs,g='href: '+location.href +bs,e='hash: '+location.hash +bs,i='agent: '+navigator.appVersion +bs,n='last mod: '+document.lastModified +bs,f='current: '+Date() +bs+bs,o='javascript: '+bs+'('+$+')()';var str=p+a+g+e+i+n+f+o;console.log(str);window.alert(str);})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment