This content originally appeared on DEV Community and was authored by Midhun
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
This content originally appeared on DEV Community and was authored by Midhun
Midhun | Sciencx (2022-01-16T06:23:23+00:00) Making a Chrome extension for Gmail notifications. Retrieved from https://www.scien.cx/2022/01/16/making-a-chrome-extension-for-gmail-notifications/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.