JinaClip README

项目的 README,来自 github.com/AhmadHassan-BTed/JinaClip。合并为一个 markdown 文件:README.md。

Jina Reader — Local Edition (v7)

Professional-Grade • Local-First • Privacy-Centric

Transform any webpage into high-fidelity, LLM-friendly Markdown entirely within the browser.

License: MIT Engine: Local-First Privacy: Zero-Cloud Author: Ahmad Hassan


Designed for AI Workflows. Engineered for Privacy.

The Philosophy

In an era of cloud-dependency and rate-limited APIs, Jina Reader (Local) represents a pivot back to local-first computing. This project eliminates the middleman, removing the need for r.jina.ai cloud calls by implementing the entire extraction and transformation pipeline directly in the browser's runtime. Content remains local, speed is absolute, and usage is infinite.


Architectural Excellence

The system is built on a modular, Service-Oriented Architecture (SOA) designed to handle the complexities of the modern web (Shadow DOM, dynamic iframes, and SPA layouts).

1. High-Level System Flow

The following diagram illustrates the lifecycle of a single "Copy" request, from the user's action to the final clipboard entry.

graph TD
    User([User Action: Click/Hotkeys/Menu]) --> Orchestrator[Background Orchestrator]
    Orchestrator --> Config[Config Service]
    Config --> Service[LocalReaderService v7]
    
    subgraph "Target Tab Context"
        Service -- Script Injection --> Engine[v7 Intelligence Engine]
        Engine -- DOM Scoring --> Root[Content Root Discovery]
        Root -- Cleaning --> Clone[Sanitized Clone]
        Clone -- Conversion --> MD[Markdown/JSON/HTML]
    end
    
    MD -- Message Passing --> Service
    Service -- Clipboard API --> OS[System Clipboard]
    Service -- Notification API --> User

2. The v7 Intelligence Engine

At the heart of the project is the Heuristic Scoring Engine. Instead of "guessing" where the content is, it calculates a text-to-link density ratio and penalizes interactive "noise" (dashboards, buttons, navs).

sequenceDiagram
    participant P as Web Page
    participant E as Intelligence Engine
    participant S as Scoring Module
    participant C as Converter
    
    E->>P: Traverse DOM Tree
    P-->>E: Candidate Elements (div, main, article)
    E->>S: Compute (Text Density - Link Density)
    S-->>E: Final Scores
    E->>P: Flatten Shadow DOM & Iframes
    E->>C: Execute Pro-Grade Markdown Conversion
    C-->>E: LLM-Friendly Payload

Feature Matrix

Feature Local Engine (v7) Cloud Reader
Privacy 100% Local Cloud Processed
Rate Limits Infinite Strictly Limited
Cost $0 Token Based
Shadow DOM ✅ Supported ❌ Limited
Table Formatting ✅ Pro Grade ✅ Basic
Full Pageshots ✅ Stitched Canvas ❌ N/A

Repository Structure

p:/extensions/JinaClip - Copy Page for LLM/
├── scripts/
│   └── build.js          # Professional packaging pipeline
├── src/
│   ├── background/
│   │   └── index.js      # Lifecycle & Event Orchestration
│   ├── services/
│   │   └── localReader.js # Core Extraction & Transformation Engine (v7)
│   ├── utils/
│   │   └── logger.js      # System-wide observability
│   └── config/
│       ├── constants.js   # Immutable definitions
│       └── defaultSettings.js
├── icons/                # High-fidelity visual assets
└── manifest.json         # Extension Manifest (MV3)

Technical Pipeline: Full Page Capture

The "Pageshot" feature utilizes a multi-stage stitching pipeline to capture full-length articles without loss of detail.

  1. Dimension Analysis: Calculates scrollHeight and viewHeight.
  2. Synchronized Scrolling: Executes discrete jumps with paint-settle delays.
  3. Canvas Orchestration: Assembles visible segments in a OffscreenCanvas.
  4. Data Delivery: Converts the final buffer to a high-quality Markdown-wrapped Base64 string.

Installation & Development

Onboarding for Contributors

The codebase is written in vanilla ES6+ to ensure zero-coupling and maximum longevity.

  1. Clone & Setup:
    git clone <repo-url>
    npm install
    
  2. Build for Production:
    npm run build
    
  3. Browser Loading:
    • Open chrome://extensions/
    • Load the dist/ folder as an "Unpacked Extension."

Professional Usage


Credits & License

This project was architected and developed by Ahmad Hassan (B-Ted) as a part of the movement toward high-performance, local-first AI tools.

Distributed under the MIT License. Contributions that align with the core philosophy of "Clean Code & User Privacy" are welcomed.


"The best way to read the web is locally."

JinaClip (AhmadHassan-BTed/JinaClip)

正在搜索数据库…

这是什么?Jina Reader (Local Edition) 是一款浏览器扩展,可以完全在浏览器内把任意网页转换为高保真、适合大语言模型(LLM)使用的 Markdown,不涉及任何云端 API。
这是 Chrome 扩展吗?还是其他浏览器也能用?它是一款 Manifest V3 浏览器扩展。安装说明是通过 chrome://extensions/ 以未打包扩展的方式加载,因此它面向基于 Chromium 的浏览器。
用它之前,我需要安装什么框架或构建工具吗?扩展本身没有运行时依赖,使用原生 ES6+ 编写。在 Chrome 中加载之前,只需运行一次构建步骤即可。
能在 Chrome 网上应用店里找到它吗?README 只记录了手动安装方式,即加载构建好的 dist/ 文件夹作为未打包扩展;文中没有提到 Chrome 网上应用店的上架信息。
我的网页内容会被发送到服务器吗?不会。整个提取和 Markdown 转换流程都在浏览器本地运行,无需调用 r.jina.ai 云服务。
它怎么判断杂乱网页中哪部分才是正文?它使用启发式评分引擎,计算文本与链接的密度比,并对仪表盘、按钮、导航栏等交互型干扰元素进行扣分,从而分离出主要内容。
它能截取整个网页的截图,而不只是文字吗?可以。它的「Pageshot」功能会滚动页面,在 OffscreenCanvas 上拼接可见部分,并以 Markdown 包裹的 Base64 图片形式输出结果。
除了 Markdown,它还支持哪些输出格式?右键点击扩展图标,除默认的 Markdown 复制外,还可以选择 JSON、HTML 或纯文本格式。
有快速抓取的键盘快捷键吗?有。按下 Alt+Shift+J 即可立即抓取,无需点击图标。
大小
0.2 MB
星标
4.2K
更新
提交Nov 09
时长
6个月
提交 · 90 天