Skip to content

rsecss/rawlink

Repository files navigation

RawLink

English | 中文

One-click copy of raw.githubusercontent.com links on GitHub file pages.

License: MIT Built with WXT Manifest V3 TypeScript


What It Does

When browsing a file on GitHub, RawLink injects a copy button next to the Raw button. One click copies the raw.githubusercontent.com direct link to your clipboard — no page navigation needed.


Features

  • One-click copy — copies the raw URL instantly on button click
  • Visual feedback — button icon turns green for 2 seconds to confirm success
  • SPA-aware — works across GitHub's client-side navigation without page reloads
  • Dual selector strategy — primary selector + fallback to handle GitHub UI changes gracefully
  • Zero permissions — no clipboardWrite or other sensitive permissions required

Installation

Developer Mode (from source)

  1. Clone the repository and install dependencies:

    git clone https://github.com/rsecss/rawlink.git
    cd rawlink
    pnpm install
  2. Build the extension:

    pnpm build
  3. Open Chrome and go to chrome://extensions

  4. Enable Developer mode (toggle in the top-right corner)

  5. Click Load unpacked and select the .output/chrome-mv3/ directory

Requirements: Node.js ≥ 18, pnpm


Development

pnpm dev            # Start HMR dev mode (auto-opens Chrome)
pnpm build          # Production build → .output/chrome-mv3/
pnpm zip            # Package ZIP for Chrome Web Store submission
pnpm typecheck      # TypeScript strict-mode type check
pnpm test           # Run unit tests once
pnpm test:watch     # Run tests in watch mode
pnpm test:coverage  # Generate coverage report

Project Structure

src/
├── entrypoints/
│   └── github-raw.content.ts   # Content script — lifecycle & event wiring
└── modules/
    ├── url-parser.ts            # Pure function: GitHub URL → raw URL
    ├── clipboard.ts             # Clipboard write + visual feedback
    └── dom-injector.ts          # Button injection & cleanup

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/your-feature
  3. Commit following Conventional Commits
  4. Open a pull request against main

License

MIT © 2026 Maple

About

⚡️Browser extension that adds a one-click “Copy raw URL” button on GitHub file pages — zero permissions, SPA-safe.

Topics

Resources

License

Stars

Watchers

Forks

Contributors