Making a Chrome extension for Gmail notifications

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 aski…


This content originally appeared on DEV Community and was authored by Midhun

Image description
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.

GET https://mail.google.com/mail/feed/atom

Solution

  1. A feed atom API call returns unread emails and total unread emails in an inbox that is logged in.

  2. In order to show an unread email when it is opened, the extension will call api and display it in the proper format

  3. 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.

  4. 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"]
}
]

Demo 🚀

Feel free to contribute on GitHub

Image description

Please comment on your ideas and thoughts, Geeks

Image description


This content originally appeared on DEV Community and was authored by Midhun


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Making a Chrome extension for Gmail notifications." Midhun | Sciencx - Sunday January 16, 2022, https://www.scien.cx/2022/01/16/making-a-chrome-extension-for-gmail-notifications/
HARVARD
Midhun | Sciencx Sunday January 16, 2022 » Making a Chrome extension for Gmail notifications., viewed ,<https://www.scien.cx/2022/01/16/making-a-chrome-extension-for-gmail-notifications/>
VANCOUVER
Midhun | Sciencx - » Making a Chrome extension for Gmail notifications. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/16/making-a-chrome-extension-for-gmail-notifications/
CHICAGO
" » Making a Chrome extension for Gmail notifications." Midhun | Sciencx - Accessed . https://www.scien.cx/2022/01/16/making-a-chrome-extension-for-gmail-notifications/
IEEE
" » Making a Chrome extension for Gmail notifications." Midhun | Sciencx [Online]. Available: https://www.scien.cx/2022/01/16/making-a-chrome-extension-for-gmail-notifications/. [Accessed: ]
rf:citation
» Making a Chrome extension for Gmail notifications | Midhun | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.