Well…ChatGPT3 taught me to write a Chrome Extension that can read my email, open the reply field and copy an AI generated reply to my clipboard. ✍️📧
I have never used JavaScript either or written an chrome extension before.
Code/explanation below 👇📄
#gpt3 #chatgpt #ai
Disclosure: my inline CSS and other code is not optimized 😁🚨
However, the code does work 🥳
manifest.json
The “core” file needed for the chrome extension. Sets permissions, name and description, etc.
popup.html
Some basic HTML and CSS to create a small popup to paste the code and instruct users.
background.js
To be honest, not entirely sure the top code is needed lol but this pops the HTML page up when the extension is clicked.
style.css
The CSS here just creates the beautiful rainbow shadow behind the button when you hover - giving it that “AI” magic feeling.
popup.js
The real magic is here - pushing the prompt to OpenAI, returning a response, finding the “Reply” button on the page since Google dynamically changes the id’s of elements 🤬👿
This was a really fun project - created by asking Chat GPT3 for instructions and looking online a little bit.
I’m sure you could integrate with the Gmail API and read the current email opened if you wanted to make it complex.
If you’re seeing this late - check out the update 👉 @TweePT3
Read more 👇
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
