Skip to content

Page Life Cycle Support #1538

@modeveci

Description

@modeveci

This ticket is for following activities regarding Page Life-Cycle support.

https://jira.rdkcentral.com/jira/browse/WPEBROWSER-54

business need/user story behind :

As an operator I need to be start and switch between WebApps quickly.
To remain competitive Operation System, RDK needs to support industry accepted Lifecycle model that allows multiple WebApps to run concurrently (and resume quickly from background) while at same time not use all scarce resources when running in background and safeguard stable operation.
As WebApp developer I would like to use industry standard solution for Lifecycle api instead of having to develop custom solution.
Technical solution agreed between Architects of Comcast-Sky-LibertyGlobal is :
As lifecycle API between Browser and the WebApp, W3C page Lifecycle need to be supported on WebEngine.
see specs & documentation:
https://developer.chrome.com/docs/web-platform/page-lifecycle-api
W3C Lifecycle model & events in diagram
https://developer.chrome.com/docs/web-platform/page-lifecycle-api/image/page-lifecycle-api-state.svg
Need to support
ACTIVE, PASSIVE, HIDDEN but very important also FROZEN state (support focus, blur, visibilitychange, freeze and resume events)
specs :
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
https://html.spec.whatwg.org/multipage/interaction.html#page-visibility
https://wicg.github.io/page-lifecycle/spec.html
Support for same page-lifecycle spec is also required by HBBTV consortium and by BBC iPlayer application.
Between the WebEngine and the platform (Middleware) the Webengine needs to support Firebolt Lifecycle 2.0 model as defined in
https://wiki.rdkcentral.com/pages/viewpage.action?spaceKey=ASP&title=Simplified+Lifecycle+2.0
Concretely this is means WebEngine needs to support Firebolt Lifecycle states initializing, Paused, Active, Suspended and Hibernated and associated transition events (onStart, onActivate, onPause, onSuspend, onResume, onHibernate, onRestore and onDestroy. OnStartSuspend is not required. WebEngine needs to support mapping of the Firebolt Lifecycle 2.0 states and events to appropriate W3C PageLifecycle states/events towards the application and release appropriate resources in associated state.
WebEngine needs to support Firebolt Lifecycle states initializing, Paused, Active, Suspended and Hibernated and associated transition events (onStart, onActivate, onPause, onSuspend, onResume, onHibernate, onRestore and onDestroy. OnStartSuspend is not required.
Process part of Webengine (eg launcher) needs to communicate (IPC) with FireboltServer (ripple) for these Firebolt Lifecycle states.
A none-thunder Webengine launcher that works with AppInfra2.0 will need to be developed as well.
Needs to be supported on existing WPE2.38 browser and on the newer upcoming versions
Above can happen in phases but must clear definition of all phases must be defined then as part of assessment of this ticket.
example Webapp Listening to W3C Pagelifecycle events
https://page-lifecycle.glitch.me/
Tool to force lifecycle (especially freeze) in chrome
chrome://discards/
There no W3C solution for communicating deeplinks from platform to WebApp but that is important business requirement (used today)
So until there is one defined at W3C we provide solution where WebApp can fetch NavigationIntent at appropriate events (load/pageshow, resume)
by calling firebolt api. discovery.getNavigationIntent This is signleton per application and platform will set the appropriate NavigationIntent before associated Lifecycle event change. that method will be added to Firebolt Discovery api and works in concert with 'Discovery.onNavigateTo' https://rdkcentral.github.io/firebolt/apis/latest/core/Discovery/#navigateto event that is already defined in firebolt api version of today

Sub-issues

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions