Skip to content

Instantly share code, notes, and snippets.

@summerwind
Last active April 27, 2016 05:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save summerwind/ea30077b55719dba5747 to your computer and use it in GitHub Desktop.
Save summerwind/ea30077b55719dba5747 to your computer and use it in GitHub Desktop.
FirstPaintTime for Firefox
var firstPaint = 0, firstPaintTime, paint;
function paintHandler() {
paint = window.performance.now()
if (firstPaint === 0) {
firstPaint = paint;
firstPaintTime = firstPaint + window.performance.timing.navigationStart;
window.performance.timing.firstPaint = firstPaint;
window.performance.timing.firstPaintTime = firstPaintTime;
}
};
window.addEventListener("MozAfterPaint", paintHandler, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment