I found myself pasting too much text into ChatGPT especially when I wanted to analyze a full document; I'd write a nice prompt, paste the document into ChatGPT, and then get annoying errors that I was over the word count. Then I'd spend a lot of time slowly pairing down the input, hoping and guessing it was below the token threshold. While there are some plugins built to do this, I was skeptical of where the data was going.
So I wrote a quick chrome plugin to count the tokens (or estimate them) and to reduce the size of the text, remove whitespace, and easily copy text between windows. It saves nothing, it requires no password or key.
You can install the plugin from the Chrome Store here.
It's a work in progress, and it's open-source; I would genuinely appreciate any help in making it more useful! MIT License to make it as permissible as possible. This is my first chrome plugin, and I used ChatGPT to help me write it.
- Count tokens.
- Protect your privacy.
- Remove whitespace from a prompt.
To package the code into a Chrome app, you'll need to create a manifest file and package the HTML, JavaScript, and CSS files into a .zip file. Here are the steps to do this:
Create a new file named "manifest.json" in the same directory. This file will contain the metadata for your app, such as the name, version, and permissions.
Zip the entire directory containing the HTML, JavaScript, CSS, and manifest files. The .zip file should contain the directory itself, not just the files within it.
Rename the .zip file to have a .crx extension (e.g. "app.crx").
To install the app, follow the steps for installing a Chrome app in developer mode, and select the .crx file instead of a directory.
That's it! You now have a packaged Chrome app that can be installed and run in Google Chrome. You can submit this app to the Chrome Web Store for review and distribution, or share it with others by providing them with the .crx file.
Here are the steps to turn the code into a Chrome app:
-
Open Google Chrome and go to the Chrome Web Store.
-
Click on the "Developer Dashboard" button.
-
Sign in with your Google account. Click on the "Add New Item" button.
-
Fill out the form with the basic information about your app, such as the name, description, and screenshots.
-
In the "Extension" section, select "Packaged App".
-
Click on the "Upload .zip file" button and select the .zip file containing your app's code.
-
Click on the "Publish Item" button to submit your app for review.
Once your app is approved, it will be available for download in the Chrome Web Store.
To install your app, go to the Chrome Web Store, find your app, and click on the "Add to Chrome" button.
Your app will now be installed and available to use from the Chrome App Launcher.
That's it! Your users can now download and install your app from the Chrome Web Store and use it just like any other Chrome app.
Update the App in the Chrome Web Store
-
Update the manifest to have a later version. Save. Zip.
-
Open Google Chrome and go to the Chrome Web Store.
-
Select your app. Then Click on "Package" on the left hand side.