How museremarkable/swufe_ccf_show_ranking works
Project type and purpose
• Type: Browser extension (Chrome/Edge/Firefox)
• Purpose:
• Inject journal/conference ranking badges on academic websites (“Show Ranking”)
• Provide in-page translation (“Online Translation”)
• Offer a simple cloud storage interface (“科研云盘”)
• (Future) Reference management and formula recognition
High-level architecture components
a. Manifest & Localization
• manifest.json
• _locales/…
b. Background Service Worker
• background/background.js
• background/html/*.html (settings pages)
• Uses chrome.runtime, chrome.storage, webRequest (if any)
c. Content Script Modules (injected into target sites)
• show_ranking/script.js + show_ranking/ranking/*.js + show_ranking/data/*.js + show_ranking/site/*.js
• translation/translation.js
• paper_manager/paper.js + paper_manager/dialog.js
d. UI Pages
• popup/popup.html + popup/js/*.js + popup/css/*.css
• background/html/*.html (author.html, home.html, etc.)
e. Assets & Libraries
• lib/js, lib/css, lib/fonts, lib/plugins
• picture/
f. External Services & APIs
• Translation APIs: Google, Baidu, Tencent, Caiyun
• Cloud storage backend: easyscholar.cc
• Data sources: static JSON/JS ranking files, Excel/PDF reference data
Interactions & Data Flow
• Startup: manifest → registers background service + content scripts (for matching URL patterns)
• Content Injection:
· show_ranking script runs on academic sites, loads local data files, processes DOM → displays ranking badges
· translation script listens for key events, sends text to background → background fetches API → returns translation → overlays DOM
· paper_manager scripts run on the cloud storage page, interacting via fetch/XHR to the backend
• User Actions:
· Background page settings (background/html/*.html) use form inputs → save to chrome.storage
• Message Passing: chrome.runtime.sendMessage / onMessage between content scripts, background, and popup
Architectural patterns & design principles
• Modular feature separation: Each major feature (ranking, translation, cloud) lives in its own directory, with its own scripts and assets
• Background + Content: Follows browser-extension pattern—long-lived background worker for centralized logic/storage; per-page content scripts for UI injection
• Local resource bundling: Static ranking data stored under show_ranking/data and injected client-side
• External API abstraction: Translation module abstracts multiple third-party APIs with a common interface