Recreating a Social Media Anti‑Addiction Chrome Extension with AI (Open‑Source)

The author adapts a Japanese developer’s forced‑break Chrome extension using GitHub Copilot (Codex) to create an open‑source add‑on that blocks prolonged browsing on any specified sites—by default Zhihu and Weibo—displaying a full‑screen cat overlay after a configurable time.

Old Zhang's AI Learning
Old Zhang's AI Learning
Old Zhang's AI Learning
Recreating a Social Media Anti‑Addiction Chrome Extension with AI (Open‑Source)

Background

A Japanese developer created a forced‑break Chrome extension that displays a large orange cat to interrupt scrolling on foreign social‑media sites such as Twitter. The author rebuilt the extension with GitHub Copilot (Codex) to add support for arbitrary domains, defaulting to Zhihu and Weibo, and released the code as open source.

Installation

Open chrome://extensions, enable Developer Mode, and load the unpacked extension directory.

Activate the extension.

Click the extension icon, then enter target domains (one per line or comma‑separated) and the desired break time.

Configuration details

Domain entries accept either line‑by‑line or comma‑separated formats; the extension normalizes the input automatically.

Break time is specified in minutes; the timer starts only after the configured threshold is reached.

Core implementation (content.js)

The script monitors pages whose URL matches any configured domain. It starts a timer when such a page loads, but the timer advances only while all three conditions hold:

The page is visible (not hidden or minimized).

The browser tab has focus.

No cat overlay is currently displayed.

If the user switches away from the tab or minimizes the browser, the timer resets to avoid counting idle time.

When the accumulated time reaches the configured threshold, the script injects a full‑screen overlay that plays a cat video and shows a countdown timer. The initial overlay used a frosted‑glass effect; it was later changed to a transparent background so the underlying page remains visible, reducing visual pressure.

Source code

The project is hosted at https://github.com/tjxj/weibo-cat. The main logic resides in content.js. Users can clone the repository, modify the extension, or install it locally following the steps above.

JavaScriptAI Code GenerationChrome Extensionopen-sourceWeb UIAnti-Addiction
Old Zhang's AI Learning
Written by

Old Zhang's AI Learning

AI practitioner specializing in large-model evaluation and on-premise deployment, agents, AI programming, Vibe Coding, general AI, and broader tech trends, with daily original technical articles.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.