Skip to content

sunfjun/chatgpt-rewriter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Text Rewriter

A Chrome extension that lets you rewrite any text field using ChatGPT. Works on Facebook, Gmail, Twitter, and any site with text inputs or contenteditable fields.

Features

  • Floating Rewrite Button — appears automatically when you focus any text field
  • Multiple Tones — choose from 7 rewrite styles:
    • Improve Writing
    • Professional
    • Friendly
    • Shorter
    • Longer
    • Fix Grammar
    • Engaging
  • Selection Support — highlight specific text to rewrite just that portion
  • Draggable Button — reposition the rewrite button anywhere on the page
  • Works Everywhere — supports <input>, <textarea>, and contenteditable fields (including React-controlled inputs)

Setup

  1. Clone the repository:
    git clone git@github.com:HongMarketingInc/chatgpt-rewriter.git
  2. Open chrome://extensions in Chrome
  3. Enable Developer mode (top right)
  4. Click Load unpacked and select the project folder
  5. Click the extension icon and enter your OpenAI API key

Usage

  1. Click any text field on a web page
  2. Highlight the text you want to rewrite
  3. Click the ✦ Rewrite button that appears
  4. Choose a tone from the dropdown

The rewritten text replaces your selection in-place.

Configuration

Open the extension popup to configure:

  • OpenAI API Key — required, stored locally on your device only
  • Default Model — GPT-4o Mini (default), GPT-4o, or GPT-3.5 Turbo

Project Structure

├── manifest.json    # Chrome extension manifest (v3)
├── content.js       # Content script — floating button, tone menu, rewrite logic
├── styles.css       # Styles for the floating UI
├── background.js    # Service worker
├── popup.html       # Extension popup (settings UI)
├── popup.js         # Popup logic (save/load settings)
└── icons/           # Extension icons (16, 48, 128px)

Privacy

Your API key is stored locally via chrome.storage.local and is only sent directly to OpenAI's API over HTTPS. It is never synced or shared with any third party.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 71.6%
  • HTML 17.7%
  • CSS 10.7%