50
ytho
7y

I'm writing my own AdBlock Extension...

CSS:
.ad {
display: none;
}

JavaScript:
if (document.getElementById("ad").playsVideoAutomatically == true) {
getBlacklist.add(window.location.hostname);
alert("You are hereby banned from browsing " + window.location.hostname + " due to automatically playing video ad.");
}

Am I doing it right?

Comments
  • 3
    Yes! :D
  • 21
    Nope, your .ad is a class and in your JavaScript your referencing an id #ad 😉
  • 5
    @theCreativeOne close enough :P
  • 2
    @theCreativeOne too lazy right now to loop through all elements by class
  • 1
    Lol so you ban the user when the page autoplays a video ad?

    :(
  • 2
    @mundo03 It's a win-lose situation. The way I see it, the site loses a visitor, and the user has to experience one less site that automatically plays ads.
  • 1
    @ytho I think this is the most eficient adblocker out there. Implement easylist filters and you are done.

    Maybe acceptable ads filters too.
  • 1
    @mundo03 No ads are acceptable for me, if they need money, and their site's good, they'll get donations in. Works the same for most Open Source software, or did you ever see ads there? ;)
  • 1
    @Gatgeagent I kind of agreeomming from video ad tech, I understand why ads exist.
    Not everyone is willing to give even 1 dollar a month for a service or content.

    And coming from adblocking, I know micro donations (in btc) are going to be a thing too really soon.

    So you are of course rigth ;)
  • 0
    I wanna pay to have my website whitelisted by your ad blocker. Please take my money
  • 1
    @crisz come-on dude, do not contribute to missinformation.
    It is not a pay to get whitelisted deal.

    If you are interested, Go to acceptableads.org,read the criteria and submit your site :)

    I
Add Comment