The Botnadzor extension is built with WXT and follows the standard browser extension architecture with three distinct entrypoints that work together to provide bot detection functionality on VK.com.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/botnadzor/extension/llms.txt
Use this file to discover all available pages before exploring further.
Architecture Overview
The extension consists of three main entrypoints:- Background Service Worker — Manages services, state, and communication
- Content Script — Injects UI elements and modifies the DOM on VK.com pages
- Popup — Provides the extension’s user interface when clicking the extension icon
Background Service Worker
The background entrypoint (src/entrypoints/background.ts) runs as a persistent service worker and serves as the central hub for:
- Service Registration — Initializes and registers all proxy services
- State Management — Manages authentication, configuration, and static lists
- Cross-Context Communication — Facilitates communication between content scripts and popup
Service Initialization
The background script registers 13 services using@webext-core/proxy-service:
src/entrypoints/background.ts
Registered Services
All services are registered at startup:| Service | Purpose |
|---|---|
AffiliationService | Checks account affiliations (bot/spam lists) |
AuthService | Manages access code authentication |
CollectingService | Collects comment data for analysis |
DxConfigService | Developer experience configuration |
ExtensionVersionService | Tracks extension version and updates |
FrontendService | Manages frontend base URL |
InspectorService | Provides comment inspection tools |
NotificationService | Browser notifications |
PopupService | Popup state management |
RegDateService | Fetches VK registration dates |
RootConfigService | Remote configuration management |
StaticListsService | Bot/spam list management |
UserConfigService | User preferences |
Background Orchestration
The background script orchestrates long-running tasks:src/entrypoints/background.ts
Content Script
The content script (src/entrypoints/content.ts) runs on VK.com pages and is responsible for:
- DOM Modification — Injects UI elements into the page
- Page Analysis — Detects page type and extracts relevant information
- Insertion Management — Manages the lifecycle of UI insertions
Content Script Initialization
src/entrypoints/content.ts
Persistent Content ID
The content script uses a persistent ID system to maintain state across page reloads:src/entrypoints/content.ts
DOM Insertion System
The content script uses a config-driven insertion system to modify the VK.com DOM. See Insertion System for details.Popup
The popup entrypoint (src/entrypoints/popup/app.tsx) provides the extension’s main UI:
- React Application — Built with React and TypeScript
- Tab-Based Interface — Multiple tabs (Stats, Config, Announcements, Access)
- Service Integration — Communicates with background services via proxy-service
Popup Structure
src/entrypoints/popup/app.tsx
Popup Features
- Stats Tab — Extension usage statistics and insights
- Config Tab — User preferences and configuration options
- Announcements Tab — Important updates and announcements
- Access Tab — Authentication and access code management
Styling Conventions
The popup uses standard Tailwind CSS classes without prefixes:Unlike content script insertions which require the
bn: prefix, the popup uses unprefixed Tailwind classes because it runs in an isolated context.Communication Flow
All three entrypoints communicate using the@webext-core/proxy-service library:
Next Steps
Insertion System
Learn how the content script modifies the VK.com DOM
Proxy Services
Understand cross-context communication