Skip to content

Instantly share code, notes, and snippets.

@MoritzGiessmann
Last active January 28, 2024 15:30
Show Gist options
  • Save MoritzGiessmann/8055285 to your computer and use it in GitHub Desktop.
Save MoritzGiessmann/8055285 to your computer and use it in GitHub Desktop.
2QR bookmarkletChanges URL to http://2qr.org/url to show a qr code leading to the page you're visiting
/**
* 2QR bookmarklet
* -------------------------
* @function Changes URL to http://2qr.org/url to show a qr code leading to the page you're visiting (2qr.org is a service by YasonBy)
* @usage Copy the code and use it as a bookmark link
* @author https://moritzgiessmann.de
*
*/
javascript:(function(){window.location.href = 'http://2qr.org/' + window.location.href;})();
@atk
Copy link

atk commented Jan 8, 2014

Without "use strict", you can omit window and directly use location.href.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment