Skip to content

Instantly share code, notes, and snippets.

@n-st
Created February 28, 2016 16:28
Show Gist options
  • Save n-st/56bbf44bd144456d04b9 to your computer and use it in GitHub Desktop.
Save n-st/56bbf44bd144456d04b9 to your computer and use it in GitHub Desktop.
Bookmarklet to generate a QR code containing the URL of the current page. Can also generate QR codes with arbitrary content when executed from an empty browser tab or called via a bookmark shortcut keyword.
javascript:void(function(){if('%s'.length>2){window.open('http://qr.kaywa.com/?s=8&d='+escape('%s'))}else{if(document.location.href.indexOf('http')!=0){t=prompt('Enter%20QR%20code%20content:','http://');if(t!=null){document.location.href='http://qr.kaywa.com/?s=8&d='+escape(t)}}else{window.open('http://qr.kaywa.com/?s=8&d='+escape(document.location.href))}}}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment