GitHub - johnmckay-reward/ad-sentinel: An AI powered ad blocker which removes ads right from the DOM

2 min read Original article ↗

Skip to content

Navigation Menu

Repository files navigation

AdSentinel

AdSentinel is an AI-powered ad blocker Chrome extension that uses OpenAI's GPT models to intelligently detect and remove advertisements from web pages.

Features

  • AI-Powered Detection: Uses OpenAI's gpt-4o-mini model to analyze page elements and determine if they are advertisements.
  • Smart Filtering: Scans for suspicious keywords (e.g., "sponsor", "promo", "banner") before sending data to the AI, ensuring efficiency.
  • User Control: Displays a non-intrusive dialog on the page showing the number of detected ads, giving you the choice to remove them.
  • Smooth Removal: Collapses ad elements smoothly using CSS transitions instead of jarring removals.

Installation

  1. Clone or Download this repository to your local machine.
  2. Open Google Chrome and navigate to chrome://extensions/.
  3. Toggle Developer mode in the top right corner.
  4. Click the Load unpacked button in the top left.
  5. Select the folder containing the AdSentinel files (the folder where manifest.json is located).
  6. The extension should now appear in your list of installed extensions.

Configuration

Before using AdSentinel, you need to provide your OpenAI API Key:

  1. Click the AdSentinel icon in your Chrome toolbar (you may need to pin it first).
  2. In the popup window, enter your OpenAI API Key.
  3. Click Save Configuration.

Usage

  1. Browse the web as normal.
  2. When AdSentinel detects potential ads on a page, a small dialog box will appear in the bottom right corner.
  3. The dialog will tell you how many ads have been identified.
  4. Click "Remove All" to hide the detected ads.

Privacy & Security

  • API Key Storage: Your OpenAI API key is stored locally in your browser using chrome.storage.sync and is never sent to any third-party server other than OpenAI itself.
  • Data Usage: Only small HTML snippets of suspected advertisements are sent to OpenAI for analysis.