Skip to content

Instantly share code, notes, and snippets.

@RoduanKD
Last active January 19, 2020 19:16
Show Gist options
  • Save RoduanKD/aaafc9e227248278b5a7a04c50d6d20f to your computer and use it in GitHub Desktop.
Save RoduanKD/aaafc9e227248278b5a7a04c50d6d20f to your computer and use it in GitHub Desktop.
/**
* A piece of code to help my friends work better.
* @author [email protected] (Roduan Kareem Aldeen)
* https://www.github.com/RoduanKareemAldeen
*/
var element = document.querySelector("div.react_meshim_dashboard_components_navBar_OldServeButton > span");
// this is the mp3 sound (feel free to change it)
var src = 'https://www.waleedalrashed.com/sounds/sms.mp3';
var sound= new Audio(src);
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type == "attributes") {
if (element.textContent != '0 requests') {
if (document.querySelector("div.meshim_dashboard_components_visitors_visitorList_renderers_PageFilteredList.visitor_list_container.incoming_table .tag_special").textContent == 'likecoupon')
sound.play()
}
}
});
});
observer.observe(element, {
attributes: true //configure it to listen to attribute changes
});
@WaleedAlrashed
Copy link

Thank you so much.
Appreciate your work

@RoduanKD
Copy link
Author

You are more than welcome

@WaleedAlrashed
Copy link

please change the sound to this one:
http://soundbible.com/grab.php?id=2156&type=mp3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment