Creating Google Chrome Extensions BETA: Adblock For Chrome

***Update Sept 2009 ***
Re-released Mark8t’s Adblock for Google Chrome via Extension


adblock chrome Creating Google Chrome Extensions BETA: Adblock For ChromeSo it has finally happened, Google has begun to open the ability for extensions to be added to Google Chrome (although it is limited in scope). We have been playing around with the documentation  since reading Matt Cutt’s post the other day. On our first project, we decided to modify our earlier Adblock code. Now it can be installed in Google Chrome automatically. It’s now a set and forget application. If you’re interested in upgrading to it, we’ll explain how(trust us, it’s easy as pie).  Then we will show you how to start making your own extensions (or at least where to start). One quick note, you need to have a recent developer build or Google Chrome 2.0 beta. So let’s start.

First, to be enable the support for extensions, you will need to  edit the target field of the shortcut field you use to launch Google Chrome. To do this, right-click on the shortcut, select “Properties” and add to the target field the following information :  --enable-extensions --load-extension="c:\extension"

What this does, is allow Google Chrome to know where your extensions will be loaded. Now you actually need to create that folder on your C drive.  Do  that by adding a new  folder and naming it  “extension”.  Next download this*(see note below–this is a new version) file, it is the Adblock script.  Unzip and drop the files into “the extension” folder. That’s it. The next time you open Google Chrome all ads will be blocked–even defeating current Adblocking blocking scripts. You can verify the load properly  by typing chrome-ui://extensions/ into the Chrome address bar. To disable you will need to delete the files from the extension folder.

Just so you know there are two files needed for every extension

The first is something called manifest.json , it will look like the below:

{
“format_version”: 1,
“id”: “00123456789ABCDEF0123456789ABCDEF0123456″,
“version”: “1.0″,
“name”: “My First Extension”,
“description”: “The first extension that I made.”
}
Here is some information on what these keys do:
  • format_version (required): Tells Chrome which version of the manifest format to use. Right now there is only one version, and it is version 1. (NOTE: Maybe we should just remove this, we can always add a format_version key later if needed).
  • id (required): A unique ID for the extension. Right now, this can be any 40 digit hexadecimal number, but in the future it will be a SHA-1 hash of the extension’s public key.
  • version (required): Is the extension’s version. You can use any number of dot-separated numbers for the version.
  • name (required): A human-readable name for the extension. (NOTE: In the future all these human-readable texts will have to be internationalized).
  • description (optional): An optional longer description of the extension.

Content Scripts is the next portion. A content script are JavaScript files that run in the context of web pages the browser loads.

You can read the rest of details here, but remember it’s still early in the development. There will be a more developed .CRX extension file formats for Chrome, and an ability to have more than one extension loaded at a time. In short, there is still much work to do. Furthermore, as time goes on the documentation will change, but the benefit of being involved early will help you get a jump start on competition. Good luck on the tweaking!

As an extra, this is our “fun” script. You can load this over the files current adblock one. See what happens when you visit Google.com with it installed. There are tons of possibilities with this…Let your imagination go…

***Note about Mark8t’s Adblock***

I know some may find it funny that an e-marketing blog  has an Adblock Script. It’s not an oxymoron. We know its a matter of time before an Adblock for Chrome is created (and so it has been), so we might as well be there first to find creative ways around it (hence our “fun” script). We support smart marketing, where annoying pop-up and distracting ads are not part of a website. That’s what this blog and our company is about. And we also know reality from our studies. Those who are comfortable enough to implement this solution will not typically be the people who click ads. Nevertheless, we must warn you, installing this script is a nuclear bomb. There is no off switch unless you delete the files. You are also depriving many sites of revenue when you use it. Please use this only as a starting point for your own development and maybe someone (or we) can work out an easy way to enable/disable the script without folder deletion to turn it off.

***Update October 2009***
Re-released Mark8t’s Adblock for Google Chrome via Extension

Print This Post Print This Post
  • Vero
    Mar 29th, 2009 at 09:36 | #1

    Works like a charm!

  • efeere
    Apr 28th, 2009 at 21:37 | #2

    i put this into the target:–enable-extensions –load-extension=”c:\extension”
    and i get this message: The name ‘enable-extensions’ specified in the target box is not valid. Make sure the path and file name are correct.
    what do i do. I already put the extensions folder on the c drive.

  • Mark8t Staff
    Apr 28th, 2009 at 22:11 | #3

    it’s two dashes
    --enable-extensions --load-extension="c:\extension"

  • EP
    May 2nd, 2009 at 21:20 | #4

    Worked great with the latest Google Chrome 2.0 beta dev build I’m using (2.0.177.1). Note that this adblock extension will not work with Google Chrome 1.0.x versions as I have checked myself. Need to be using Chrome 2.0 betas only.

  • Mark8t Staff
    May 2nd, 2009 at 22:09 | #5

    This is true as I mentioned in the article. It only works on the beta 2.0 :)

  • Benoit
    May 3rd, 2009 at 13:03 | #6

    I get the following
    Could not load extension from 'c:\extension'. Manifest is missing or invalid.

  • Mark8t Staff
    May 3rd, 2009 at 13:15 | #7

    You need to load the script to ‘c:\extension’ first and you need to make sure you are using the Chrome 2.0

  • Mark8t Staff
    May 3rd, 2009 at 14:00 | #8

    We have decided to close comments on this post. Our goal was not to become a developer or support Adblock for Chrome. We just wanted to start working on the the reality of Adblock in Chrome and share our early development of extensions with our readers. In this regard, we look to the future. We support the team over at Adsweep and look forward to see where they take this extension in the future. You can check it out here.

  • Jeremy Y
    Sep 15th, 2009 at 12:35 | #9

    The newest Dev Channel builds now have extensions enabled by default, so it might be time to revisit adblock.

  • Mark8t Staff
    Sep 15th, 2009 at 18:44 | #10

    We just noticed this. We will evaluate this over the coming weeks, but we have some other projects taking precedent :)

  • Mark8t Staff
    Sep 22nd, 2009 at 20:56 | #11
  • jerryleen
    Oct 7th, 2009 at 00:27 | #12

    its really complicated procedure, i guess firefox..if u say download this file why there is no link, Y we have to search entire page for it???

  • Mark8t Staff
    Oct 7th, 2009 at 06:09 | #13

    Hi Jerry
    please notice that at the top and bottom of the page we are noting we have updated to a new version of adblock. We will try to make it clearer.

    Thanks for the comment

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>