This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(w) { | |
if (!w || !("performance" in w) || !w.performance || !performance.getEntriesByName) { | |
return; | |
} | |
BOOMR = w.BOOMR || {}; | |
BOOMR.plugins = BOOMR.plugins || {}; | |
BOOMR.plugins.WaitForMark = { | |
markFound: false, | |
init: function() { | |
var markName = "cav"; | |
function poll() { | |
var entries = performance.getEntriesByName(markName); | |
if (entries.length == 0) { | |
return setTimeout(poll, 500); | |
} | |
BOOMR.plugins.WaitForMark.done(); | |
BOOMR.sendBeacon(); | |
} | |
poll(); | |
}, | |
done: function() { | |
this.markFound = true; | |
}, | |
is_complete: function() { | |
return this.markFound === true; | |
} | |
}; | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Question: do they want to set page load time to when the mark fires, or is page load time still tied to onload and the mark is just measured as a custom timer? If the former, then you will have to update t_done to be the mark's time.