window.onDvtagReady = function (callback, timeout = 750) { window.dvtag = window.dvtag || {}; dvtag.cmd = dvtag.cmd || []; const opt = { callback, timeout, timestamp: new Date().getTime() }; dvtag.cmd.push(function () { dvtag.queueAdRequest(opt); }); setTimeout(function () { const cb = opt.callback; opt.callback = null; if (cb) cb(); }, timeout); };