/copyGPT

A small javascript bookmarklet for copying chatGPT transcripts to your clipboard.

Primary LanguageJavaScriptMIT LicenseMIT

copyGPT

This is a small JavaScript Chrome bookmarklet for copying ChatGPT transcripts to your clipboard with some light Markdown formatting. It works on both desktop and mobile Chrome.

ChatGPT is an incredible demonstration of a large language model. But, as of Dec 11, 2022, it makes copying transcripts really hard, especially on mobile. This simple bookmarklet provides a workaround until ChatGPT introduces a "copy transcript" feature.

I designed this against Google Chrome, though it may work with other browsers.

This is similar to jcubic/chat-gpt, which lets you download the transcript as HTML. The main difference is that copyGPT converts the transcript to Markdown and copies it to your clipboard.

Features

  • Simple, transparent JS bookmarklet for copying ChatGPT transcripts as Markdown.
    • Handles code blocks.
  • Support for both desktop and mobile Chrome.

Known Issues

  • Fragile: This relies on the current DOM structure of ChatGPT. Changes to the structure may break this bookmarklet. Updates will be reflected but will require manual reinstallation (i.e., updating the URL field of the bookmark with the new JS).

Installation

  • Copy the JavaScript from copyGPT-markdown.js.
  • On a computer:
  • On mobile:
    • If you have Chrome Sync enabled:
      • The bookmark created on your computer will sync to your mobile device if you've configured Chrome Sync.
    • Otherwise: follow the relevant Android, iPhone, or iPad instructions to:
      • Visit any site on mobile and create a new bookmark.
      • Edit the bookmark to change the name to copyGPT and paste the JavaScript into the URL field.
      • (As far as I can tell, manually creating a bookmark isn't possible on mobile Chrome. This is a workaround.)

Usage

Use ChatGPT in the usual way. When you have a transcript you'd like to copy on desktop or mobile Chrome:

  • Stay on the ChatGPT tab.
  • Enter copyGPT in the Chrome address bar.
  • Select the copyGPT suggestion. This executes the JavaScript against the ChatGPT page.
  • Done! The transcript is copied to your clipboard. Paste it in your favourite note-taking tool.

Demo

This demonstrates both installation and usage:

copyGPT.demo.mov

Contributing

Pull requests and issues welcome!

Note: as far as I can tell, mobile Chrome has a limit of 5000 characters on the URL field. To maintain compatibility with mobile Chrome, change requests which cause the bookmarklet to exceed this limit will be rejected.