Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify what retainContextWhenHidden does to webview scripts when switching focus #48719

Closed
octref opened this issue Apr 25, 2018 · 0 comments
Closed
Assignees
Labels
verification-needed Verification of issue is requested verified Verification succeeded webview Webview issues
Milestone

Comments

@octref
Copy link
Contributor

octref commented Apr 25, 2018

#48453

Currently, with retainContextWhenHidden: true, and I have an editor with a webview next to each other, this happens:

  • Cat keeps counting to 40
  • When I switch focus to editor, cat stops counting
  • When I switch back to the webview, cat starts counting from 40

This says the script code stops execution when I switch away from webview. However, a common understanding of "background-script" is that it keeps running in the background. I believe it needs to be made clear:

  • What happens to a running script when you switch focus away
  • What get restored and how they get restored. Do you take a snapshot of the DOM and restore the DOM and rerun the script? Do you keep the script execution context and restore it? Those remain a bit vague.
@octref octref added the webview Webview issues label Apr 25, 2018
mjbvz added a commit to microsoft/vscode-docs that referenced this issue Apr 26, 2018
@mjbvz mjbvz added this to the April 2018 milestone Apr 26, 2018
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Apr 26, 2018
@mjbvz mjbvz closed this as completed in 8f1f772 Apr 26, 2018
@dbaeumer dbaeumer added the verified Verification succeeded label Apr 27, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
verification-needed Verification of issue is requested verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants