Prompt template
Run these steps in order.
01
Create a JavaScript bookmarklet that inserts a green “Submit File” button before the element with the class '.flex.flex-col.w-full.py-2.flex-grow.md\:py-3.md\:pl-4'. Style the button with white text, 5px padding, no border, a 5px border radius, and 5px margin. 02
Insert a progress container before the same target element. Set its width to 99%, its height to 5px, and its background color to grey. Inside it, add a progress bar div with 0% width, 100% height, and a blue background. 03
Attach a click event listener to the “Submit File” button. When clicked, create a hidden file input that accepts '.txt', '.js', '.py', '.html', '.css', '.json', and '.csv' files, then open the file selection dialog. 04
After a file is selected, read it asynchronously as text and split it into chunks of 15,000 characters each. 05
For each chunk, set the ChatGPT textarea selected by `textarea[tabindex='0']` to `Part part of filename:` followed by the chunk text. Dispatch a keydown event simulating the Enter key to submit the chunk. 06
After submitting each chunk, update the progress bar’s width incrementally to reflect upload progress. 07
Before submitting each subsequent chunk, wait asynchronously until ChatGPT is ready, checking whether the element '.text-2xl > span:not(.invisible)' is visible. 08
After all chunks have been submitted, change the progress bar’s background color to blue to indicate completion.