I created a Chrome extension to show a barcode for your current tab’s URL in a lightweight popup window. I use it all the time when I’m presenting – people can take out their phones and browse to the site I’m demoing.
The code is dead simple:
var img = document.getElementById("barcode-img"); chrome.tabs.query({currentWindow: true, active: true}, function(tabs){ var uri = img.src = tabs[0].url; var encoded = encodeURI(uri); var chartUri = "https://chart.googleapis.com/chart?cht=qr&chs=500x500&chl=" + encoded; img.src = chartUri; });
i.e. – we get the URL for the current tab, create a google chart image of the encoded url, and set the src of an image in the popup window to that url.
The code’s available on github, and the extension is available for free on the Chrome Extension Store.