FANDOM


PrivateMessageAlert tells you when a private chat is updated (and you're not focused on the chat tab) by adding a blinking message to the tab name informing who messaged you.

Installation

Customization

All variables are stored in the PrivateMessageAlert object, which must be defined before the importArticles statement.

beepSound
This can be a string or an array of publicly available, valid mp3/ogg/wav files.
interval
The interval between the tab switching state between users, in milliseconds. Please don't set this to below 1000.
message
This overrides the translations for your own text to display on the title (and desktop notifications). It replaces $1 with the user who messaged you.
notifications
Boolean that defines if the script should display desktop notifications. It will still ask for permission to show them the first time you run the script, so it should be ok to have this set wiki-wide.
alertWhileFocused
By default, the script won't do anything if you're viewing the document. This changes it so you still get a notification if you're focused on the window.

Example:

window.PrivateMessageAlert = $.extend(window.PrivateMessageAlert, {
    beepSound: 'https://soundbible.com/grab.php?id=1645&type=mp3',
//  beepSound: ['https://soundbible.com/grab.php?id=1645&type=mp3', 'https://soundbible.com/grab.php?id=1815&type=mp3'],
    message: '$1 sent you a message!',
    notifications: true,
    alertWhileFocused: true,
    interval: 2000
});
// importArticles...
Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+