Consider first-run page loaded on DOMContentLoaded event
Background / User story
In #833 (closed) we started opening a web-based first-run page. In order to make sure users are seeing the first-run page, we decided to switch to the local variant if the web-based variant hasn't finished loading after three seconds. However, due to long connection times and some optional resources (e.g. fonts, third-party scripts) delaying the "load" event, in some cases, we end up redirecting the user away from the page even though its content is already visible.
Therefore we could wait for the "DOMContentLoaded" event instead, as long as we can guarantee that all required content is visible and interactive at that point.
Alternatively, we could try opening the first-run page in the background and only make it visible after it finished loading. That would allow us to significantly increase the timeout and avoid a situation where we're replacing one page with another.
What to change
- Design: N/A
- Research: N/A
- Spec: TBD
- Legal: TBD
-
Development: Use
browser.webNavigation.onDOMContentLoaded
instead ofbrowser.webNavigation.onCompleted
for determining when web-based first-run page has finished loading.
Hints for testers
In addition to the previous scenarios, the web-based first-run page should be kept open if its DOMContentLoaded
event has been dispatched within three seconds from opening the tab. That means that the page should be fully rendered, but some requests (e.g. images, fonts, deferred scripts) may still be loading.
Hints for translators
N/A
Integration notes
N/A