Skip to content

Capturing state of a web view when it becomes invisible #48542

@dbaeumer

Description

@dbaeumer

Tests #48453

While reading through the documentation I got the impression that when a web view panel becomes invisible we dispose the underlying web view. Before we do so we capture the HTML and basically put it back when the panel becomes visible again.

However I found no good way to capture any state of the web view when this happens other than constantly sending state from the web view to the extension. What I would like to code is the following (I didn't test it though):

  • the extension receives a willChangeViewStateEvent. When the event is received the web view is still functional and the extension can send message to capture some state to the web view.
  • when restore and the web view has JS enabled we should be able to call a restore hook (see also We should try to make the message extension <-> WebView communication more secure #48540) with some captured state so that the view can restore its state properly before it renders.

However I am not a WebView expert so I am not sure if this is possible.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions