Created
June 10, 2014 12:47
-
-
Save kafene/36c9b5af8bd80ca7f4cd to your computer and use it in GitHub Desktop.
Comcast Webmail Adblock Userscript
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
// 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