How fivefold/linkding-injector works
Main Components
a. Browser Extension Components:
• Background Service (represented by background.js)
• Content Scripts (searchInjection.js)
• Options Page (options.svelte)
• Configuration Manager (configuration.js)
b. External Systems:
• Linkding Server (self-hosted instance)
• Supported Search Engines (Google, DuckDuckGo, SearX/SearXNG, etc.)
• Browser API Interface (browser.js)
┌─ Browser Environment ─────────────────────────────────────┐
• ┌─ Extension ─────────────────────┐ │
• ┌─ Background Service ───┐ │ ┌─ Web Pages ─┐│
• Event Handling ◄─────────────┐ Search ││
• API Communication │ │ │ Engines ││
• ▲─────────┘ │ │ ││
• ┘│
• ┌───────────┴─────────┐ │ │
• Content Scripts │ │ │
• Search Injection │ │ │
• UI Integration │ │ │
• ▲─────────┘ │ │
• ┌──────────┴──────────┐ │ │
• Options Page │ │ │
• Configuration UI │ │ │
• ┘ │ │
• ┬───────────────┘ │
• ┼─────────────────────────────────────┘
┌────────────────▼────────────────┐
• Linkding Server │
• Bookmark Storage & Search │
• ┘
Key Interactions to Highlight
a. Content Script Injection Flow:
• How searchInjection.js injects into supported search engine pages
• How the injected UI appears in the search results sidebar
b. Data Flow:
• Search query from search engine to background service
• Background service communication with linkding server
• Results injection back into the search page
c. Configuration Flow:
• Options page to configuration storage
• Configuration retrieval by background service
Important Technical Details
• Manifest Version differences (V2 for Firefox, V3 for Chrome)
• SCSS/CSS styling system
• Browser API abstraction layer
• Theme detection system
Additional Notes
• A note about the experimental nature of SearX/SearXNG support
• Theme detection system's integration with the browser
• Build system's role in generating different versions for Firefox and Chrome