A missing feature in Gmail is that you cannot refresh your linked email accounts conveniently. It seems to bother the community as you can see here and here in the Gmail Help Community, and here at stack exchange. You can speculate that Google doesn't like that feature, maybe thinking people will use their Gmail account or switch to G-Suit aka Google Workplace. Anyways, this shouldn't be the topic here.
The current state with Gmail
The way Google is calculating the interval to check on your mail accounts is depending on how often you receive an email. This technique is especially not helpful when you are waiting for e.g. a signup confirmation email. Some resources stating a click on the refresh icon will trigger your accounts to get refreshed. A quick check on the settings page shows that it's more like a dummy and doesn't refresh POP3 mail accounts.
An effective way of retrieving your emails is through “Settings” → “Accounts and Import” → “Check email from other accounts”-section and clicking on “Check mail now”. However, this is a tedious and annoying process that screams for automatization.
Bookmarklet to check all mail accounts in one click
Let's solve this with a simple bookmarklet! A bookmarklet is JavaScript code saved as a bookmark, which can be run with a single click.
Here is the code, I'm going to explain it later.
What the email bookmarklet does
- Due to security reasons (CORS) you have to run the bookmarklet from your Gmail tab. Therefore, the bookmarklet will first check if you're in the right window. In my case I always have the Gmail window pinned to my tab bar.
- It will then automatically navigate to your Gmail Settings.
- After 100 milliseconds it will check if the Gmail Settings have loaded completely. To do so, it will try to access the links to refresh each POP-account. This is being done through XPath since IDs and classes will change over time.
- If it can succesfully access the links, the links will get clicked and it will load the Gmail inbox again. If the page is not ready yet, it will try again after 100 milliseconds.
- Done, now your inbox with all your email accounts should be up-to-date! (thanks to Nathan Stretch at this point for speeding up the execution time of the script)
⚠️ Attention, there is a pitfall
You cannot simply copy the JavaScript code, it needs to have some adjustment: No line breaks or single-line comments are allowed and you have to put a 'javascript: ' at the beginning. Here you'll find a way to quickly get rid of your line breaks.
The final bookmarklet for Gmail
Here is the code of the bookmarklet without line breaks:
The only thing you have to do is to insert the JavaScript code as URL of a bookmark to add the bookmarklet to your browser.
Note: Gmail takes a few seconds to refresh the inbox so you have to wait a bit after clicking the bookmarklet and refresh the inbox page (CMD/STRG
+ R
)
Using Gmail in a different language than english
If you are using Gmail in a different language, you have to adjust the “Check mail now” at the following position, so the script will be able to access the refresh links:
Enjoy!