Skip to content

Instantly share code, notes, and snippets.

@kafene
Created June 10, 2014 12:47
Show Gist options
  • Save kafene/36c9b5af8bd80ca7f4cd to your computer and use it in GitHub Desktop.
Save kafene/36c9b5af8bd80ca7f4cd to your computer and use it in GitHub Desktop.
Comcast Webmail Adblock Userscript
// I don't always read my Comcast webmail, but when I do, I do it without ads 8-)
/web.mail.comcast\.net/i.test(location.hostname) &&
(function () {
var selectors = [
'#table_adsrvc',
'#comcast-adsrvc',
'#comcast-skyscrapperad',
'iframe[title=Advertisement]',
'#skin_td_tree_bottom_ad',
'#skin_container_top_ad',
];
var removeAds = function () {
selectors.forEach(function (selectors) {
var ad;
if (ad = document.querySelector(selectors)) {
try {
ad.parentNode.removeChild(ad);
} catch (a) {
}
}
});
};
setInterval(function () {
removeAds();
}, 500);
document.addEventListener('DOMContentLoaded', function () {
removeAds();
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment