How ayasa520/bilibili-favorites-exporter works
Project type and purpose
• This is a browser extension (Chrome/Firefox) whose goal is to let users export and view their B站(Bilibili)收藏夹 (favorites) as JSON and then browse them in a standalone UI.
• Key indicators: presence of manifest.json; directories for css, js, HTML pages (popup.html, display.html); README describing “浏览器扩展.”
File structure
• Top‐level files:
• manifest.json – extension manifest, declares content scripts, background script, UI pages
• README.md, COPYING – docs
• Directories:
• css/ – styles for injected content and for the display UI
• js/ – logic for background.js, content.js, popup.js, display.js
• HTML pages:
• popup.html – extension popup (from toolbar) to “查看收藏夹” (view)
• .html – standalone viewer that loads the exported JSON
• .html is not injected; it is a dedicated page opened in a new tab or extension tab
• Key scripts:
• content.js – injected into B站收藏夹 page to insert “导出收藏夹” button, scrape video list, call Biliplus when needed
• background.js – handles long‐running tasks, cross‐origin fetches, and triggers the JSON download
• popup.js – handles UI in the extension popup (file drag‐and‐drop, search, sort)
• .js – renders the JSON data into a paginated list with search/sort
README for additional insights
• Features: light/dark mode, local save only, no server, uses Biliplus for missing videos
• Workflow:
a. On B站 page, click export → data scraped → download JSON
b. In popup or display page, load JSON → view by folder → search/sort → details
Elements
• Green for in‐page scripts (content.js/css)
• Blue for background processes
• Orange for UI pages (popup/display)
• Gray for external services
• Rectangles for code components
• Clouds for external services/APIs
Final advice
• Be exhaustive but clear: capture every extension component and its interactions.
• Don’t over-modularize—focus on the six main pieces (manifest, content, background, popup, display, external).