Skip to content

Instantly share code, notes, and snippets.

@claytonrothschild
Created January 30, 2025 01:43
Show Gist options
  • Save claytonrothschild/e5f2088a62675231205bfa351a60deff to your computer and use it in GitHub Desktop.
Save claytonrothschild/e5f2088a62675231205bfa351a60deff to your computer and use it in GitHub Desktop.
GoHighLevel Bookmarklet: Make sound when new notification

problem to solve

GoHighLevel does not play notification sounds properly, especially when a live chat comes in. This causes you to lose your chance to respond to the live chat in a timely manner.

This script ensures a sound is played when notifications, such as live chat notifications, turn on.

technical explanation

The script continuously checks if the #recent_activities-toggle element contains -notification. If present, it starts playing a sound repeatedly. If removed, it stops the sound. The loop runs every 1 second.

how to use

Copy the Code Below. Create a New Bookmark in your browser. Paste the Code into the "URL" field of the bookmark. Save it. Click the Bookmark whenever you want the notification check to be active.

javascript:(function(){let audio=new Audio("https://www.myinstants.com/media/sounds/bell.mp3");audio.loop=true;function checkNotification(){let el=document.querySelector("#recent_activities-toggle%22);if(el&&el.classList.contains(%22-notification%22)){if(audio.paused){audio.play();}}else{audio.pause();audio.currentTime=0;}}setInterval(checkNotification,1000);})();

Fully expanded, this is the code:

javascript:(function(){
    let audio = new Audio("https://www.myinstants.com/media/sounds/bell.mp3"); // Replace with your preferred sound URL
    audio.loop = true; // Ensure it plays continuously

    function checkNotification() {
        let el = document.querySelector("#recent_activities-toggle");
        if (el && el.classList.contains("-notification")) {
            if (audio.paused) {
                audio.play();
            }
        } else {
            audio.pause();
            audio.currentTime = 0;
        }
    }

    setInterval(checkNotification, 1000); // Check every second
})();

how to improve this

This could show a visual cue on the page that the "plugin" is active. It could be installed as a greasemonkey plugin (is that still a thing?)

shameless plug

If this is helpful, please check out CloudPano - www.cloudpano.com or considering using my instance of GHL - www.leadstack.ai

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