What I think is by far the easiest way to do this, is to simply create a custom search engine (Chrome/Opera) or bookmark shortcut (Firefox), with qr
as keyword. This will allow you to generate a QR code by just typing qr Foo Bar Baz
in your URL bar.
For this search engine then, you can use a simple and fast public QR API, such as the following:
http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=|1&chl=%s http://api.qrserver.com/v1/create-qr-code/?size=200x200&data=%s
Both of these will result in a 200x200px QR code, and although both these APIs will return a different QR code, they will both decode to the original string, with roughly the same amount of data-loss recovery.
See https://google-developers.appspot.com/chart/infographics/docs/overview and http://qrserver.com/api/documentation/create-qr-code/ respectively for the documentation on both of those URLs. As you can see, the latter also allows some extra functionality such as bgcolor
and color
. So, I think it's probably better to use QRServer instead of using Google's deprecated charts.
Setting up shortcut bookmarks or search engines
You can set up these search engines and bookmarks in a couple of different ways for different browsers. It shouldn't be too hard for either of the listed ones though. Internet Explorer does not support this, and for as far as I could find on the internet, Safari doesn't either, other than what this guide explains (which seems to be something slightly different).
Google Chrome
In Chrome you can create a new search engine for this going to, where you can pick between the 2 urls listed above. This is based . You can also manually add the search engine via the following steps:
- Either use this JSBin to easily select one of the two options listed above (JSBin code is based on the code provided here)
- Or go to
chrome://settings/searchEngines
, and in the window that shows up, scroll to the bottom, and enter:- In the first input box, enter the search engine's description ("QR Code" for example)
- In the second input box, enter the keyword that triggers the search engine ("qr" for example)
- In the third input box, enter the target URL, with the part you're going to be typing in replaced with
%s
(the URLs listed above are already in this format)
Keep in mind that if you've got automatic search suggestion enabled (like Google's suggestions), this may interfere with the shorter keywords. To fix this, you can just change the keyword to qr.
since the period behind it will stop Chrome from treating it like a search phrase automatically.
Firefox
Firefox uses bookmarks instead of search engines, but the end result is the exact same.
You can create a shortcut bookmark in one of two simple ways:
Method 1:
- Go directly to the base URL:
- http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=|1&chl=%s
- http://api.qrserver.com/v1/create-qr-code/?size=200x200&data=%s
- Note: If these links show an error, just ignore it. It's caused by the occurrence of
%s
in the URL, but after setting up the bookmarks this won't be a problem.
- Press Ctrl+D to create the bookmark
- A popup window will show up. In it, enter:
- In the top input box, enter the bookmark's description ("QR Code" for example)
- In the bottom input box, enter the keyword that triggers the bookmark ("qr" for example).
- Since you created the bookmark on the url containing
%s
already, you don't have to do anything else to configure the URL.
Method 2:
- Create a bookmark anywhere, and configure it
- Press Ctrl+D anywhere to create a dummy bookmark
- See step 3 for the first method
- Open the bookmark's properties:
- If you saved it to the toolbar, right click it and select the bottom option (Properties)
- If you saved it to anywhere other than the toolbar, open your bookmarks interface via Ctrl+Shift+B, and simply select it.
- In the second input box of the bookmark's properties (Location), change the url to the url you want to use.
Opera
Opera, like Chrome, uses search engines too, but unlike Chrome, you'll have to do it via the settings:
- Press Ctrl+F12 to open the Preferences window
- Go to the Search tab (middle tab)
- Press the "Add..." button (top button), and enter:
- In the top input box, enter the search engine's description ("QR Code" for example)
- In the second input box, enter the keyword that triggers the bookmark ("qr" for example)
- In the third input box, enter the target URL, with the part you're going to be typing in replaced with
%s
(the URLs listed above are already in this format) - If there is no third input in this window, press the button to the right of the input box that says "Details > >" to show further options.
I hope this helps at least some people. I've told a couple of people I know about this, and most of them found it useful, so I decided to create this post so that others might find it useful too.