8000 Webview: display:none seems to cause it to be garbage collected and using it after that will crash Atom-Shell · Issue #764 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Webview: display:none seems to cause it to be garbage collected and using it after that will crash Atom-Shell #764
Closed
@frankhale

Description

@frankhale

OS: Windows 8.1 x64
Atom-Shell: 0.19

Sorry for all the editing and deleting of my previous reports but the issue is morphing and I've narrowed it down. Apparently the webview is garbage collected when you set it's CSS display property to none. If you do this then you cannot use the webview again and if you try to set it's src it will crash Atom-Shell.

<!DOCTYPE html>
<html>
<head>
  <title>webview crash test</title>
</head>
<body>
  <webview id="web" style="width:100%;height:100%;position:absolute;"></webview>
  <script>
    window.onload = function() {
      var web = document.getElementById("web");
      web.src = "http://msn.com";
    };
  </script>
</body>
</html>

Reproduce the crash:

In your main.js make sure you have it open the dev tools once it creates a new browser window. Use the dev tools to set the CSS display property for the webview to none. Set the src of the webview using the console. Observe Atom-Shell crash.

Now a point of clarification: This sounds convoluted but I was using display:none to hide the webview, set the source and then show it in my app. I should have been using visibility:hidden instead. My UI is just set up to show the webview in the entire width/height of the window but underneath of it there is a list of links to choose from. This is the reasoning I found this issue. Using visibility:hidden makes the crashing go away.

Question, does calling display:none on the webview cause the webview to be garbage collected?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0