Here's how I made a simple Chrome extension for Gmail notifications
Midhun
Posted on January 16, 2022
Blue Bell Gmail™ notification tool
I was searching for a simple extension that would allow me to quickly view new e-mails received. I found some of the greatest extensions. But what impressed me the most is their ability to show my Gmail without asking for my password explicitly. Honestly, this was a real shock to me.
These extensions can display my email without even asking for my password, which made me both fearful and curious. I eventually ended up at Gmail's feed API.
Gmail Inbox Feed
The Gmail Inbox Feed will output your Inbox as an XML document. You can use an RSS aggregator to view this, or you can consume the feed with your own app.
Solution
A feed atom API call returns unread emails and total unread emails in an inbox that is logged in.
In order to show an unread email when it is opened, the extension will call api and display it in the proper format
Unread email listeners must notify. It is necessary to have a background script when we want to run anything in the background for an extension.
In that case, the feed API is read every minute if there is an unread email update extension badge with a count.
Permission Required
"content_scripts": [
{
"matches": ["*://mail.google.com/*"],
"js": ["contentScript.bundle.js"]
}
]
Feel free to contribute on GitHub
Please comment on your ideas and thoughts, Geeks
Posted on January 16, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
September 30, 2024