Last active
August 16, 2020 11:53
-
-
Save khandar-william/cde42c8f9e1e5694ad101df09b2c52a9 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
// Tokopedia | |
function removeAdsType1() { | |
var adsType1 = document.querySelectorAll('a[label-atm="taProduct"]'); | |
adsType1.forEach(function (e) { | |
e.parentNode.remove(e); | |
}); | |
} | |
window.setInterval(removeAdsType1, 10000); | |
function removeAdsType2() { | |
var container = document.querySelector('div[data-testid="divSRPContentProducts"]'); | |
var adsType2 = container.querySelectorAll('a[href*="/promo/"]'); | |
adsType2.forEach(function (e) { | |
if (!e.href.match(/clicks/)) return; | |
var d = e.parentNode.parentNode.parentNode.parentNode; | |
d.parentNode.remove(d); | |
}); | |
} | |
window.setInterval(removeAdsType2, 10000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment