How heyhuazi/xiaobottools works
XiaoBotTools is a Chrome extension that augments XiaoBot pages. Its main workflow detects article pages, builds a hierarchical table of contents from their headings, and lets readers jump to those headings. It also adds a ranking shortcut to the navigation bar and watches for URL changes so the interface can be refreshed on client-side navigation. The runtime behavior is visible in js/content.js; manifest.json is listed in the tree but was not sampled, so extension registration details are not shown.
Main entry points: content.js Page initializer
Components 9
Page integration
- Page lifecycle
js/content.js - URL watcher
js/content.js - Page initializer
js/content.js
Table of contents
- TOC builder
js/content.js - Heading links
js/content.js
Navigation links
- Ranking shortcut
js/content.js
Other components
- Reader
- XiaoBot article page
- Ranking site
Connections 9
- Page lifecycle → Page initializer: starts on load
js/content.js - URL watcher → Page initializer: restarts after URL change
js/content.js - Page initializer → Ranking shortcut: adds shortcut
js/content.js - Page initializer → TOC builder: initializes on article pages
js/content.js - TOC builder → XiaoBot article page: scans headings and inserts TOC
js/content.js - TOC builder → Heading links: creates heading anchors
js/content.js - Reader → Heading links: selects heading
README.md - Heading links → XiaoBot article page: jumps to heading
README.md - Ranking shortcut → Ranking site: links to ranking site
js/content.js