var link1="https://www.google.com/search?q=marketing"; //var link2="https://stackexchange.com/"; var tab=window.open(link1,"_blank"); setInterval(function(){checkTabsClosed()},3000); function checkTabsClosed()…