Add 1 extra delayed big frames render at page load
Without getting into the whole CSS transitions problem, this is a quick solution to ensuring that text both loads as quickly as possible and also loads aftera delay fo 500ms when hopefully all page load transitions have completed. Touches #39
This commit is contained in:
parent
f01b72daeb
commit
802a61204d
|
@ -98,7 +98,13 @@ export default class extends utils.mixins(CommonMixin, CommandsMixin) {
|
||||||
_setupInteractiveMode() {
|
_setupInteractiveMode() {
|
||||||
this._setupDebouncedFunctions();
|
this._setupDebouncedFunctions();
|
||||||
this._startMutationObserver();
|
this._startMutationObserver();
|
||||||
this.sendAllBigFrames();
|
this.sendAllBigFrames()
|
||||||
|
// Send again for pages that have page load transition effects :/
|
||||||
|
// TODO:
|
||||||
|
// Disabling CSS transitions is not easy, many pages won't even render
|
||||||
|
// if they're disabled. Eg; Google's login process.
|
||||||
|
// What if we could get a post-transition hook?
|
||||||
|
setTimeout(()=> {this.sendAllBigFrames()}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
_setupDebouncedFunctions() {
|
_setupDebouncedFunctions() {
|
||||||
|
|
|
@ -42,8 +42,8 @@ export default class extends utils.mixins(CommonMixin, SerialiseMixin) {
|
||||||
|
|
||||||
buildFormattedText() {
|
buildFormattedText() {
|
||||||
this._updateState();
|
this._updateState();
|
||||||
this.graphics_builder.getScreenshotWithText();
|
|
||||||
this.graphics_builder.getScreenshotWithoutText();
|
this.graphics_builder.getScreenshotWithoutText();
|
||||||
|
this.graphics_builder.getScreenshotWithText();
|
||||||
this._getTextNodes();
|
this._getTextNodes();
|
||||||
this._positionTextNodes();
|
this._positionTextNodes();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue