Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Javascript snippit to hide/censor price tags on a website. (Note: seems to break interaction with the site, use at own risk)
(function(context) {
var priceCensor = "X.XX";
var pattern=/(\$)(\d([\d\,\.]+)?)/g,
callback=function(_,dollar,price) {
return dollar + price;
html = context.innerHTML.replace(pattern,callback);
context.innerHTML = html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.