You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Wrong OCI will be picked up if the page is scrolled and the beacon script is fired after.
This issue will handle the rocket-scripts side.
See the LCP image will be related to the current viewport
Identify the root cause
The issue is that the OCI data is collected incorrectly if the user scrolls before the beacon fires. This can happen when the user scrolls on mobile or refreshes the page away from the fold.
Scope a solution
To solve the issue, we must create a new function in BeaconManager.js:
and finalize the process of beacon if it returns true:
asyncinit(){this.scriptTimer=newDate();if(!awaitthis._isValidPreconditions()){this._finalize();return;}if(this._isPageScrolled()){this.logger.logMessage('Bailing out because the page has been scrolled');this._finalize();return;}// ...
Development steps:
Create the function _isPageScrolled()
Modify init function to finalize if the newly added function returns true.
Effort estimation:
XS
Is a refactor needed in that part of the codebase?
No
The text was updated successfully, but these errors were encountered:
* Closes#31: Add a check if page is scrolled down.
* move isPageScrolled method to Utils class
---------
Co-authored-by: WordPressFan <[email protected]>
Describe the bug
Wrong OCI will be picked up if the page is scrolled and the beacon script is fired after.
This issue will handle the
rocket-scripts
side.Reproduce the problem
Identify the root cause
The issue is that the OCI data is collected incorrectly if the user scrolls before the beacon fires. This can happen when the user scrolls on mobile or refreshes the page away from the fold.
Scope a solution
To solve the issue, we must create a new function in BeaconManager.js:
and finalize the process of beacon if it returns
true
:Development steps:
_isPageScrolled()
init
function to finalize if the newly added function returns true.Effort estimation:
XS
Is a refactor needed in that part of the codebase?
No
The text was updated successfully, but these errors were encountered: