Skip to content

AI-powered browser extension for instant link previews. Hover over any URL to get concise AI summaries, read times, and credibility scores without leaving your page. Boost research and productivity with on-demand context, powered by Gemini.

License

Notifications You must be signed in to change notification settings

chirag127/PeekInsight-AI-Link-Preview-Browser-Extension

Repository files navigation

PeekInsight-AI-Link-Preview-Browser-Extension

PeekInsight Hero Banner Placeholder

Build Status Code Coverage Top Language License GitHub Stars

Star this Repo


πŸ’‘ Blurb: The Value Proposition

PeekInsight is an advanced, AI-driven browser extension designed to eliminate context-switching by providing instant, intelligent link previews. Hover over any hyperlink to immediately receive concise, credible summaries and estimated reading times directly in your workflow.

πŸ—ΊοΈ Architecture Overview

This extension adheres to a highly decoupled Micro-Frontend/Service architecture, separating the browser logic (DOM manipulation/UI) from the intensive AI processing (Node.js/Gemini API gateway).

mermaid graph TD A[User Hover/Click] --> B{Browser Extension Layer (JS/HTML/CSS)}; B -- Request URL/Content --> C[Background Service Worker]; C -- API Call (HTTPS) --> D(Node.js/Serverless Gateway); D -- LLM Request --> E[Google Gemini API]; E -- Structured JSON Response --> D; D -- Formatted Preview Data --> C; C -- Inject DOM Overlay --> B; B --> F[Intelligent Link Preview Display];

subgraph Client Side
    B
    F
end

subgraph Server Side / AI Processing
    D
    E
end

πŸ“‘ Table of Contents

  1. πŸ’‘ Blurb: The Value Proposition
  2. πŸ—ΊοΈ Architecture Overview
  3. πŸ“‘ Table of Contents
  4. βš™οΈ Technical Stack (2026 Standard)
  5. πŸ€– AI Agent Directives
  6. πŸš€ Getting Started
  7. βœ… Development Standards
  8. πŸ“œ License

βš™οΈ Technical Stack (2026 Standard)

This project utilizes modern, high-performance web technologies tailored for extensions and real-time API interaction.

Component Technology Purpose
Frontend/UI HTML5, Vanilla JavaScript (ES Modules) Core extension logic, DOM injection, popup rendering.
AI Backend Node.js (Serverless Target) Securely proxying requests and managing Gemini API interactions.
AI Engine Google Gemini API (Pro Model) Summarization, entity extraction, and credibility scoring.
Web Scraping Puppeteer/Playwright (Server-side dependency) Fetching inaccessible content for deep analysis.
Manifest Manifest V3 Compatibility with modern browser security standards.

πŸ€– AI Agent Directives

Click to view Apex Architecture & Verification Commands (Essential for Future Maintenance)

SYSTEM: APEX TECHNICAL AUTHORITY & ELITE ARCHITECT (DECEMBER 2025 EDITION)

1. IDENTITY & PRIME DIRECTIVE

Role: You are a Senior Principal Software Architect and Master Technical Copywriter with 40+ years of elite industry experience. You operate with absolute precision, enforcing FAANG-level standards and the wisdom of "Managing the Unmanageable." Context: Current Date is December 2025. You are building for the 2026 standard. Output Standard: Deliver EXECUTION-ONLY results. No plans, no "reporting"β€”only executed code, updated docs, and applied fixes. Philosophy: "Zero-Defect, High-Velocity, Future-Proof."


2. INPUT PROCESSING & COGNITION

  • SPEECH-TO-TEXT INTERPRETATION PROTOCOL:
    • Context: User inputs may contain phonetic errors (homophones, typos).
    • Semantic Correction: STRICTLY FORBIDDEN from executing literal typos. You must INFER technical intent based on the project context.
    • Logic Anchor: Treat the README.md as the Single Source of Truth (SSOT).
  • MANDATORY MCP INSTRUMENTATION:
    • No Guessing: Do not hallucinate APIs. Use linkup/brave to search for December 2025 Industry Standards, Security Threats, and 2026 UI Trends.
    • Validation: Use docfork to verify every external API signature.
    • Reasoning: Engage clear-thought-two to architect complex flows before writing code.

3. CONTEXT-AWARE APEX TECH STACKS (LATE 2025 STANDARDS)

Directives: Detect the project type and apply the corresponding Apex Toolchain.

  • PRIMARY SCENARIO: WEB / APP / EXTENSION (TypeScript/JavaScript)
    • Stack: This project leverages HTML/JS (Manifest V3). Key tools are Vite 7 (for build tooling, if bundled), Biome (for linting/formatting standardization), and Vitest/Playwright (for testing).
    • Architecture: Adheres to a Feature-Sliced Design (FSD) approach within the extension structure (Shared -> Entities -> Features -> App).
    • API Contracts: All communication between the content script and background service worker MUST use structured messages adhering to TypeScript interfaces to ensure type safety across boundaries.

4. ARCHITECTURAL PRINCIPLES MANDATE

  • SOLID Compliance: Especially Dependency Inversion (D) for the AI Layer, ensuring the UI does not directly instantiate the Gemini client.
  • DRY: Logic for URL parsing and validation must be centralized.
  • YAGNI: Avoid feature creep; focus purely on high-quality link preview generation.

5. VERIFICATION AND BUILD

To ensure architectural integrity and deployment readiness, execute the following local verification sequence:

  1. Format & Lint Check (Biome): npx @biomejs/biome check --apply .
  2. Unit Testing (Vitest - Mocked API Calls): npm test (or equivalent script for Vitest execution)
  3. Static Manifest Validation: Manual check or tool to confirm Manifest V3 compliance.
  4. E2E Test Execution (Playwright): npx playwright test (Verify DOM injection succeeds across major sites like Wikipedia/Medium).

πŸš€ Getting Started

Prerequisites

  • Node.js (LTS version, recommended 20+)
  • npm or yarn (Package Manager)
  • Google Gemini API Key (Required for server-side proxy testing)

Installation

  1. Clone the Repository: bash git clone https://github.com/chirag127/PeekInsight-AI-Link-Preview-Browser-Extension.git cd PeekInsight-AI-Link-Preview-Browser-Extension

  2. Install Dependencies: (Assuming standard npm setup based on extension development patterns) bash npm install

  3. Configure Environment Variables: Create a .env file in the root to store your secure API key (used by the local proxy/testing environment).

    GEMINI_API_KEY="YOUR_SECRET_KEY_HERE" NODE_ENV=development

Running Locally (Development Mode)

For testing the extension logic and UI:

Command Description
npm run build Compiles and bundles the extension assets for deployment.
npm run dev Starts a local server for component testing/hot reloading (if using Vite dev server).
npm test Runs Vitest unit tests against core logic.

To use it, load the /dist folder as an unpacked extension in Chrome/Firefox Developer Mode.

βœ… Development Standards

We rigorously adhere to established architectural best practices:

  • SOLID: Especially the Dependency Inversion Principle (D) to decouple the UI from the specific AI provider.
  • DRY (Don't Repeat Yourself): URL fetching and parsing utilities are centralized in the shared/utils module.
  • YAGNI (You Ain't Gonna Need It): Features are implemented strictly against current requirements; future complexity is deferred until necessary.

πŸ“œ License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.

See the LICENSE file for full details.

About

AI-powered browser extension for instant link previews. Hover over any URL to get concise AI summaries, read times, and credibility scores without leaving your page. Boost research and productivity with on-demand context, powered by Gemini.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •