Last active
March 29, 2019 07:58
-
-
Save corsonr/5cedaf808e4e79b48c07c2228e8989ed to your computer and use it in GitHub Desktop.
A8C - Once key field auto-filler
This file contains hidden or 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 A8C - Once key field auto-filler | |
// @namespace http://automattic.com/ | |
// @version 0.1 | |
// @description Pre-fill Once fields | |
// @author Remi Corson | |
// @match https://<place_mc_url_here>/once/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var getUrlParameter = function getUrlParameter(sParam) { | |
var sPageURL = decodeURIComponent(window.location.search.substring(1)), | |
sURLVariables = sPageURL.split('&'), | |
sParameterName, | |
i; | |
for (i = 0; i < sURLVariables.length; i++) { | |
sParameterName = sURLVariables[i].split('='); | |
if (sParameterName[0] === sParam) { | |
return sParameterName[1] === undefined ? true : sParameterName[1]; | |
} | |
} | |
}; | |
var key = getUrlParameter('key'); | |
$("input[name='key']").val(key); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@corsonr I'd like to propose small addition. If we pop this on line 32, this can be a mouseless operation
The Show Message button gets focus and you can just hit
Enter
on the keyboard.I tried to go one step further and
.click();
the button but that was causing all sorts of weirdness so I left it off.