/x-ai-content-filter-on-device-ai

Filter X content using LLM API requests, configurable, based on Chrome built-in AI

Primary LanguageJavaScriptApache License 2.0Apache-2.0

X Content Filter

Overview

The X Content Filter is a browser extension that analyzes and filters content on X.com based on configured topics. It uses the Chrome on-device AI to perform the analysis.

Installation

  1. Clone the repository or download the source code.
  2. Open your browser's extension management page (e.g., chrome://extensions/ for Chrome).
  3. Enable "Developer mode".
  4. Click "Load unpacked" and select the source code directory.

Usage

  • The extension automatically analyzes and hides posts on X.com that exceed the configured thresholds using the Chrome on-device AI.
  • To reset the cache, run resetCache() in the browser console.

Configuration

Topics and thresholds can be modified in content.js.

const topicsConfig = [
    {"topic": "politics", "description": "posts about political subjects", "threshold": 0.8},
    {"topic": "negativity", "description": "posts with overly negative sentiment", "threshold": 0.9}
];

Files

  • manifest.json: Extension manifest file.
  • content.js: Main script for analyzing and filtering posts.