Skip to content

Joe-Huber/CopyPastePlus

Repository files navigation

CopyPaste+

CopyPaste+ banner

Top Language Code Size Last Commit Issues Forks Stars License: MIT

Expand the functionality of copy/paste in Chrome. CopyPaste+ captures your copied text and gives you a history with favorites and usage counts, available right from the toolbar popup.

Features

  • Automatic capture of copied/cut text from pages and editable fields
  • Popup history with sections:
    • Favorites (star items you care about)
    • Most Used (by copy count)
    • Recent Items (chronological)
  • Click any item in the popup to copy it back to the clipboard
  • Star toggle (☆/★) to mark favorites
  • Clear non-favorites action to prune your history quickly
  • Persistent storage using chrome.storage.local
  • Settings page with following options:
    • Theme
      • System Default - Light - Dark
    • Truncate long items in the popup
    • Hiding certain selection sections (eg: Most Used, Most Recent, favorites)

Installation (from source)

  1. Clone this repository
  2. Install dependencies
    • npm install
  3. Build the extension
    • npm run build
  4. Load into Chrome
    • Open chrome://extensions
    • Enable "Developer mode"
    • Click "Load unpacked" and select the repository root directory

An option for installing from the Chrome Web Store may be added in the future; dependent on demand and project popularity.

Usage

  • Copy text as you normally do (keyboard shortcuts or menu) on regular web pages
  • Click the CopyPaste+ toolbar icon to open the popup
  • Click an item to copy it to your clipboard
  • Click the star on an item to favorite/unfavorite it

Notes and limitations:

  • Chrome restricts extension behavior on certain pages (e.g., chrome:// pages, the Chrome Web Store, some PDF viewers, new tab, and other special URLs). Copy capture and/or popup copy may not function there.
  • Copies can only be directly detected from a page or this extentsion, so copies from other extensions or from the url will not be detected.
  • Copies are only detected when the content script is active on a page. This means that if you install the extension and copy something on a page that was already open, it may not be captured until you refresh that page.
  • Clipboard access is on the browser only, so copying from system apps (outside Chrome) will not be captured.

Development

Requirements:

  • Node.js LTS
  • npm

Commands:

  • Install deps: npm install
  • Build: npm run build

Project structure (high level):

  • manifest.json — Chrome MV3 manifest
  • background.ts — background service worker
  • content.ts — content script (listens to copy/cut)
  • popup.tsx, popup.html, popup.css — popup UI (React)
  • dist/ — compiled JS bundles (generated)
  • webpack.config.js — build configuration

Tips:

  • Background/service worker logs: chrome://extensions → your extension → "Service worker" → Inspect
  • Content script logs: open DevTools on a target page’s frame (not on restricted pages)
  • If you modify sources, run npm run build and reload the extension

Permissions rationale

  • storage — store copy history and item metadata
  • clipboardWrite, clipboardRead — improve clipboard interactions from allowed contexts
  • activeTab, scripting — inject a small copy routine into the active tab as a fallback when direct popup clipboard writes are not available
  • host_permissions: <all_urls> — allow content script to observe copy events across pages you visit

Privacy: CopyPaste+ does not send your data anywhere. All history is stored locally via chrome.storage.local and never leaves your machine.

Troubleshooting

  • I don’t see any captured copies
    • Ensure you’re testing on a normal HTTP/HTTPS page (not chrome://* or the Web Store)
    • Open the page console and look for content script logs
    • Reload the extension in chrome://extensions and refresh the page
  • Error in Chrome developer settings and nothing gets added from the clipbaord anymore
    • Reload the extentsion and make sure you are on a refreshed tab. If your tab is from before the extentsion's most recent change you made, the incorrect script will be injected and it won't work.

Contributing

Contributions are welcome!

  • Open an issue for bugs and feature requests
  • Fork, create a feature branch, and submit a pull request
  • Keep PRs focused and include a brief description and testing notes
  • Don’t commit build artifacts (dist/) or dependencies (node_modules/). The repo includes a .gitignore that ignores these

Ideas and TODOs:

  • Check the project's Issues page for known problems, improvements, or feature ideas.

License

This project is open source. See the LICENSE file for details.

Releases

No releases published

Packages

No packages published