Giter Club home page Giter Club logo

ka-block's Introduction

Ka-Block!

A Safari browser extension that blocks an artisanal selection of advertising domains.

Ka-Block

State of the art

The most popular ad blocking extensions take a no holds barred, nuke them from orbit approach. The goal is not only to never see an ad on a web page, but to never see the sad, empty space left behind by the ad that used to be.

While this is highly effective, there is a heavy price to pay. The list of rules filtering out advertisements in these extensions weighs in at over 1 MB. It includes partial domain matches, URL fragments, highly specific HTML element identifiers that were found on at least one web page at some point in the last decade. They may or may not exist on any page today, and there's no way to verify their existence.

These filtering rules also contain a whitelist of allowable ads. If your corporation pays their corporation enough money, the ad blocker allows your ads through so the visitor may view them. Not only did you pay for the ad, you paid a third-party for it to actually be viewed by a human.

That's a nice billboard you have there. It would be a shame if something happened to it.

This list must be refreshed periodically in our browsers. The extension makes a network connection, downloads the list again, and stores it in memory. Some ad blocker extensions take this opportunity to store unique information about us on their servers. Sites visited, links clicked, type of browser, and operating system information can all be stored on their server to build a profile of each user.

The irony of an extension designed to protect a person's privacy, violating it within seconds of installing is delicious.

There must be a better way

This extension's goals are modest.

  • Block most ads and trackers.
  • Never contact a server.
  • Never slow down a page.

Some ads will get through this filter, and that's ok. We already have extensions that block every ad that's ever appeared on the web with a completionist zeal that must be admired. Provided we accept the tradeoffs described above, those blockers work great.

This ad filtering code makes zero network connections. The only way for the list of blocked domains to be updated is to release a new version of the extension itself.

The filtering is implemented in less than 100 lines of JavaScript. Each time an image or JavaScript file is requested by a page, Safari checks with this extension to determine if it's allowed to download it. If the resource is served by a blocked domain, it's rejected and the browser doesn't download it at all.

Installation

Ka-Block! can be installed from the Safari Extensions Gallery.

Alternatively, you can download the latest Ka-Block.safariextz file and double-click to install.

Updating the domain list

If there's a pesky ad-serving domain that's getting through the filter, open a pull request with the domain and a site or two on which its ads appear. We'll add it to the blocked domains list and release a new version of the extension to include it.

License

Ka-Block! is released under the terms of the MIT license. Check the LICENSE file for details.

<3

ka-block's People

Contributors

dgraham avatar josh avatar enure avatar

Watchers

Dieter Komendera avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.