JSFiddle - React, Tailwind, and code Playground

HTML

<a id="b" href="#">pop</a>

JavaScript

function pop_init() {
        alert('pop');
}
var timer=false;
window.reportChildActivity = function() {
    if(timer!==false) {
        clearTimeout(timer);
    }
    SESSION_ALIVE = true; 
    timer=window.setTimeout(pop_init, 1000); 
}
    
$('#b').click(function() {
    var w=window.open('','','width=300,height=200');
    w.document.write("<button id='c'><script>document.getElementById('c').onclick=function() {window.opener.reportChildActivity()};</"+"script>");
});