Entry Concepts
Entries correspond to the functional modules of browser extensions, such as background scripts, content scripts, popup pages, etc. Addfox provides three configuration methods that can be used individually or in combination.
What are Entries
Browser extensions consist of multiple independent functional modules, each requiring an entry file:
Configuration Methods
Method 1: File-based (Recommended)
Do not configure entry, let the framework discover entries automatically by directory and file name.
Advantages:
- Zero configuration, follow conventions
- Add new entries by simply creating directories
- Clear code structure
See File-based Entry.
Method 2: Config-based (entry + manifest)
Configure entry-related capabilities through entry and manifest in addfox.config.ts:
Advantages:
- Centralized entry and manifest configuration
- Support custom entry names
- Can override auto-discovery results
See Config-based Entry and manifest configuration.
Hybrid Usage
These three methods can be used in combination with the following priority:
- Highest:
entryin config - Second: Source file paths in manifest
- Third: Auto-discovery
Core Principles
Entries must be JS/TS
Addfox is built on Rsbuild, and the real build entries can only be .js, .jsx, .ts, .tsx script files.
HTML Handling
- Entries without HTML:
background,contentonly need script files - Entries with HTML:
popup,options,sidepanel,devtools,offscreen- If no HTML is provided, Rsbuild will auto-generate (containing
<div id="app"></div>) - If providing custom HTML template, must mark entry script with
data-addfox-entry
- If no HTML is provided, Rsbuild will auto-generate (containing
Example: Custom HTML Template
Built-in and Custom Entries
Built-in Entries (Reserved Names)
The following names have special meanings and are automatically recognized by Addfox:
Built-in entry names cannot be changed. The framework relies on these names for automatic recognition and manifest path filling.
Custom Entries
In addition to built-in entries, you can configure any name in entry as a custom entry (e.g., capture, my-page):
Custom entries produce standalone pages accessible via chrome-extension://<id>/capture/index.html.
Next Steps
- File-based Entry — Learn convention-based entry discovery
- Config-based Entry — Learn explicit entry + manifest configuration
- manifest configuration — Configure extension capabilities

