-
-
Save WillBrubaker/0d065b10f149822ed1ec8c6eef0fc644 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://mc.a8c.com/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]; | |
} | |
} | |
}; | |
$(document).ready(function() { | |
var key = getUrlParameter('key'); | |
if (key.length > 0) { | |
$("input[name='key']").val(key); | |
$('#once-get form').submit(); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment