In the background script we have:
chrome.webRequest.onBeforeRequest.addListener(function (details) {
if (details.method === 'HEAD') {
if (details.url.endsWith('?start')) {
ringSound.play();
} else if (details.url.endsWith('?stop')) {
ringSound.pause();
ringSound.currentTime = 0;
}
}
}, { urls: [ 'https://*.gruveo.com/api/ring?*' ] } );
In the webapp we do:
fetch('https://www.gruveo.com/api/ring?' + (start ? 'start' : 'stop'), { method: 'HEAD' }).catch(function () {});
You can get our extension from https://chrome.google.com/webstore/detail/gruveo-instant-connect/jlongfhigcebblbebgmpobcgjhlhegcc and analyze it.