Estoy tratando de usar un trabajador web para llamar a una función geoValidate en una página de navegador inactiva basada en un temporizador específico. Mi función geoValidate en sí funciona bien cuando la llamo manualmente (o acorto el temporizador para que se ejecute cuando la página aún está activa), pero soy nuevo y tengo problemas conceptuales para configurar el trabajador web.
showPabeValidate.js
const date = Date().toString(); const currentDateParse = Date.parse(date); const trigger = Date.parse(startTime) + (1000 * 60 * 15)// this is 15 mins after the event starts setTimeout( geoValidate, (trigger - currentDateParse)) function geoValidate () { // the code in here works fine } }trabajador.js
addEventListener('message', geoValidate => { // not even sure where to start here }) ¿Cómo podría unir estas dos funciones y activar la función geoValidate en función del activador del temporizador trigger - currentDateParse