Created
October 24, 2016 10:11
-
-
Save evanxd/fc5eb3e33732567957aa0c02baaffc00 to your computer and use it in GitHub Desktop.
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
// Please refer to https://dxr.mozilla.org/mozilla-central/source/browser/base/content/tab-content.js#375-393 | |
onPaintWhenWaitedFor: function(forceNonArticle, event) { | |
if (!event.clientRects.length) { | |
return; | |
} | |
this.cancelPotentialPendingReadabilityCheck(); | |
var t0 = content.performance.now(); | |
var isProbablyReaderable = ReaderMode.isProbablyReaderable(content.document); | |
var t1 = content.performance.now(); | |
dump("Call to isProbablyReaderable took " + (t1 - t0) + " milliseconds. \n"); | |
if (isProbablyReaderable) { | |
sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: true }); | |
} else if (forceNonArticle) { | |
sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: false }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment