Last active
September 13, 2021 13:30
-
-
Save gabrieljones/1348d3119da460b17143af81a6ef82a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name QR This SVG | |
// @namespace https://gabrieljones.dev/ | |
// @include * | |
// @version 0.1 | |
// @author Gabriel Jones | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant GM_registerMenuCommand | |
// @grant GM_download | |
// ==/UserScript== | |
(function(){ | |
if (top.location !== this.location){ | |
return false; | |
} | |
GM_registerMenuCommand( 'QR This Page', () => { | |
const uriEncoded = encodeURIComponent(location.href+"?qr=20210912"); | |
GM_download("https://api.qrserver.com/v1/create-qr-code/?data=" + uriEncoded + "&format=svg&qzone=4", document.title+".svg"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment