Often, in ChatGPT, I'll ask it to create some example code or whip up a small script for me, but I don't like having to copy the code and paste it over my existing code or create a new file to put the code in. This Chrome extension solves that problem by placing download links next to the existing "Copy code" links.
- Download this code.
- Go to chrome://extensions
- Click the switch in the top right to enable Developer Mode
- Click the Load Unpacked button in the top left and navigate to the directory where you stored this code.
- Close the Extensions page
- Click the Extensions puzzle piece in the browser bar on the right and then click the pin to pin this extension.
- After you've gotten some code back from ChatGPT, click the extension to make it add download links (it will add them for the last 5 code blocks).
- To download a code block, click a download link (the little floppy disk). It will initiate a file download with the contents of the code block as the file and the filename that was above the block as the filename in the Save As dialog. If there was no filename, it will default to code.txt.
- While in a session, click the extension.
- Click the Save chat button.
- Choose where to save the generated HTML file.
Before | After |
---|---|
- Make the popup useful. Just click the Close button when it pops up for now.
- I'm not great at creating Chrome extensions, but I'm learning.
- ChatGPT 3.5 wrote most of this extension
- If you see something to improve, feel free to create a pull request or an issue.
- Save file icons created by Flat Icons - Flaticon
- highlightjs - used for code syntax highlighting