change background.js into split typescript files for better managemand and build background.js from typescript

This commit is contained in:
2026-05-01 19:28:36 +02:00
parent fb78fd0471
commit 7ee664153b
17 changed files with 2261 additions and 1636 deletions
+15 -2
View File
@@ -95,8 +95,9 @@ browser-cli/
│ └── session.py # session save/load
├── extension/
│ ├── manifest.json # MV3 extension manifest
│ ├── background.js # Service worker command dispatcher
│ └── content.js # Content-script helpers
│ ├── content.js # Content-script helpers
│ └── src/ # TypeScript source split by command area
│ └── index.ts # Builds generated extension/background.js
├── examples/
│ ├── demo.py # Python API walkthrough
│ └── demo.sh # Bash CLI walkthrough
@@ -402,6 +403,18 @@ bash examples/demo.sh
---
## Development
```sh
npm ci
npm run check:extension # type-check, build extension/background.js, syntax-check bundle
uv run pytest -q
```
The extension source lives in `extension/src/`. `extension/background.js` is generated and ignored by git. Run `npm run build:extension` before using `Load unpacked` with `extension/`.
---
## Limitations
- **Browser internal pages** (`chrome://`, `brave://`, `edge://`, `about:`) cannot be scripted. DOM and extract commands only work on regular `http://` and `https://` pages.