Transferring URLs from Firefox to a Smartphone
Today, my friend Alex was trying to type in the URL for a webpage I had open on my PC into his Android phone. And I thought out loud that it would be a weekend project to write up a Firefox app to generate the QR Code of the URL for the current tab. Alex being Alex, he immediately created a bookmarklet in Firefox to generate the QR Code and then used that QR Code to browse to the webpage he was typing into his phone.
The bookmarklet is so handy, I decided to post it here (after some cleanup and modifications from Alex’s original version). So, here is the script for the URL QR code generator bookmarklet.
javascript:(function(){window.open("http://qrcode.kaywa.com/img.php?s=8&d="+window.location)})() |
You can use any QR Code reading app on your phone to read the URL. I have an Android (T-Mo G1) and I use the free ‘Barcode Scanner’ app available in the Android Marketplace.
This doesn’t work with all URLs. Adding escape(window.location) helps, but not quite all the way. The following seems to work with all locations:
javascript:void(window.open(“http://qrcode.kaywa.com/img.php?s=8&d=”+escape(window.location).replace(/+/g,’%252B’)))