Last active
June 2, 2017 18:17
-
-
Save a-pasquale/bce51850e74cf36087f83e754fc2b7c7 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 Add to Cart Text Replacer | |
// @namespace https://holyokecodes.org/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Andrew Pasquale | |
// @match */* | |
// @grant none | |
// @require http://code.jquery.com/jquery-3.2.1.min.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
$('div, p, h1, h2, h3, li, span, a').contents().filter(function() { | |
// Filter text nodes | |
return this.nodeType == 3; | |
}).each(function(){ | |
this.textContent = this.textContent.replace(/Add to [Cc]art/g, 'Buy for Andrew!'); | |
// Or whatever text you want to replace... | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment