Sends a desktop notification when your inbox has an unread
Brief
This is an improvement upon a userscript posted by Kivl on Rule34.xxx forum's stickied thread for Useful Addons, Scripts, Guides. This extensive rework implements a lock so that only one tab runs the mail check timer. Efforts is expended toward insuring the lock and mail state tracking is accurate.
Limitations
At this time, only one notification will be sent between mailbox checks. That is, a notification will be sent for the first piece of mail received. Any subsequent mail received before the user checks their mail will not generate a notification. After mail is checked, another notification may be received when a new piece comes in, even if not all items in the mailbox were read.
Compatibility
There is a bug to do with injection cache values in newer versions of TamperMonkey that messes with the locking mechanism. Initial page loads of tabs on the site will lock fine, but if they are refreshed, they will lose the lock and start the timer, duplicating it even. I do not know how to resolve this problem, as what known bugs exhibiting it did not appear to apply to our use case. ViolentMonkey appears not to surface this problem as often; if you do notice it, try restarting your web browser.
Roadmap
In a future update, the userscript will be reworked to improve the mail check function. The aforementioned drawback may be overcame by reading the DOM of the mailbox page for unread parcels directly, instead of relying on the 'New mail' banner. This will allow us to reliably send a notification for each piece of new mail received, without the need for the user to check their mailbox in between.