tilt-shift photography of HTML codes

QR Coder – Version 2

This is an update to my original QR Coder browser bookmark script. It’s been a while, and the Google Chart APIs I was using for this stopped working few days ago.

This is my daily use app, and unfortunately there’s still no way to easily transfer text info from one device to another without going through cloud.

In this update, I am now using GoQR service by FoundData. It’s pretty easy to use, and the service offers APIs to encode and decode QR code. Which is awesome. There’s also web form where one can generate QR codes.

For this update I’m breaking QR Coder in two parts.

QR Link

QR Link generates a QR code of the page you’re currently on. So you can share it with another device.

javascript:(function(){function QRCoder(){var u=window,t=document,n=t.createElement("div"),r=t.createElement("img"),i;r.src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+encodeURI(window.location),n.id="QRCoder",n.style.padding="50px",n.style.border="1px solid #f00",n.style.textAlign="center",n.style.backgroundColor="#ccc",n.onclick=function(){t.body.removeChild(t.getElementById("QRCoder"))},i=t.createElement("div"),i.style.fontFamily="serif",i.innerHTML="tap to hide",n.appendChild(r),n.appendChild(i),n.style.zIndex=6999,n.style.position="fixed",n.style.top="10px",n.style.left=u.innerWidth/2-130+"px",t.body.appendChild(n)}QRCoder();})()
  • Copy all the code shared above
  • Its one line of code, no line breaks
  • Bookmark this page, and edit the bookmark
  • Change bookmark’s name to “QR Link”
  • Paste the copied code in bookmark’s location / URL field
  • Save the bookmark. That’s it!

QR Text

QR Text is simple, and I’ve been using it in this form for long time. This is for quickly generating a QR code for your own custom text. Say, you need to make a call to a number on PC? no problem. QR Text, tel:+18001234567.

Or anything else text based, it’ll quickly make a QR code of it, but you need to be on some website. As on some browsers’ home feed doesn’t let this script work.

javascript:(function(){function QRCoder(){var u=window,t=document,n=t.createElement("div"),r=t.createElement("img"),i;r.src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+prompt("Text data", ""),n.id="QRCoder",n.style.padding="50px",n.style.border="1px solid #f00",n.style.textAlign="center",n.style.backgroundColor="#ccc",n.onclick=function(){t.body.removeChild(t.getElementById("QRCoder"))},i=t.createElement("div"),i.style.fontFamily="serif",i.innerHTML="tap to hide",n.appendChild(r),n.appendChild(i),n.style.zIndex=6999,n.style.position="fixed",n.style.top="10px",n.style.left=u.innerWidth/2-130+"px",t.body.appendChild(n)}QRCoder();})()
  • Copy all the code shared above
  • Its one line of code, no line breaks
  • Bookmark this page, and edit the bookmark
  • Change bookmark’s name to “QR Text”
  • Paste the copied code in bookmark’s location / URL field
  • Save the bookmark. That’s it!

Oh yeah, you want the link to this page as QR code, here you go!

qr code

This works on latest Firefox, Edge, Chrome and mobile versions of these browsers too.

Do let me know how you use it and if you have any feedback.

Leave a Reply