I'm trying to close a model pop-up which appears after 60 minutes if the rockradio.com tab is in the background.
I created this script and added it to Tampermonkey:
// ==UserScript==
// @name Don't bug me, Rockradio
// @namespace http://www.rockradio.com
// @description Closes the "Are you still there?" dialog box
// @include https://www.rockradio.com/*
// @exclude https://www.rockradio.com/login
// @grant none
// @run-at context-menu
// @version 1.0
// ==/UserScript==
/* jshint -W097 */
'use strict';
setInterval(function() {
var modal = document.getElementById('modal-region');
if (typeof(modal) !== 'undefined' && modal !== null && modal.children.length !== 0) {
document.querySelectorAll("button[type='button']")[1].click();
}
}, 1000);
But this pop-up:
is not closed when I right-click: page -> Tampermonkey -> script name.
Also, there are no errors; so no idea what's wrong.