Last active
April 9, 2016 22:33
-
-
Save BrianCanFixIT/2d9ca18c1e36d6f596c222a0d47180e5 to your computer and use it in GitHub Desktop.
officialpayments.com Allow copy-paste into check information confirmation fields
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 Official Payments Copy-Paste | |
// @namespace officialpayments.BrianCanFixIT | |
// @description officialpayments.com Allow copy-paste into check information confirmation fields | |
// @downloadURL https://gist.github.com/BrianCanFixIT/2d9ca18c1e36d6f596c222a0d47180e5/raw/Official_Payments.user.js | |
// @include https://www.officialpayments.com/* | |
// @version 1.6 | |
// @grant none | |
// ==/UserScript== | |
var scriptCode = new Array(); // this is where we are going to build our new script | |
// here's the build of the new script, one line at a time | |
//basically we're going to overwrite the functions that prevents you from doing a copy-paste, with one that does nothing | |
scriptCode.push('function clearPaste(x){}' ); | |
// now, we put the script in a new script element in the DOM | |
var script = document.createElement('script'); // create the script element | |
script.innerHTML = scriptCode.join('\n'); // add the script code to it | |
scriptCode.length = 0; // recover the memory we used to build the script | |
// this is sort of hard to read, because it's doing 2 things: | |
// 1. finds the first <head> tag on the page | |
// 2. adds the new script just before the </head> tag | |
document.getElementsByTagName('head')[0].appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment