Skip to content

Instantly share code, notes, and snippets.

@BrianCanFixIT
Last active April 9, 2016 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianCanFixIT/2d9ca18c1e36d6f596c222a0d47180e5 to your computer and use it in GitHub Desktop.
Save BrianCanFixIT/2d9ca18c1e36d6f596c222a0d47180e5 to your computer and use it in GitHub Desktop.
officialpayments.com Allow copy-paste into check information confirmation fields
// ==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