Last active
April 3, 2025 20:04
-
-
Save peterjaap/93048e8388312ab1fd9984cb7cb35c28 to your computer and use it in GitHub Desktop.
Remove coupon field when Coupert extension is detected. Adjustable to also block Capital One Shopping, Rakuten, CouponCabin Sidekick, Dealfinder, RetailMeNot, Ibotta and Honey
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
(function() { | |
var detectExtension = function(url, ifInstalled, ifNotInstalled) { | |
var link = document.createElement('link'); | |
link.rel = 'stylesheet'; | |
link.href = url; | |
link.onload = ifInstalled; | |
link.onerror = ifNotInstalled || function() {}; | |
document.head.appendChild(link); | |
}; | |
detectExtension( | |
// Change the below URL to a web accessible resource in the Chrome extension | |
// For the Chrome ID, see the Chrome extension on the Chrome Web Store and check the address bar for the URL | |
// For the filename, download the CRX with https://crxextractor.com/ and rename it to .zip | |
// Extract it and see web_accessible_resources in the manifest.json of the crx (zip) file and pick a css/font file | |
'chrome-extension://mfidniedemcgceagapgdekdbmanojomk/css/font.css', | |
function() { | |
var selector = '#coupon-code-input-field'; | |
var target = document.querySelector(selector); | |
if (target && target.parentNode) { | |
target.parentNode.removeChild(target); | |
console.log('Coupert detected, removed coupon code field.'); | |
} | |
} | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment