<p dir="auto">MacOSX10.9: AtomShell v0.20.4</p>
<p dir="auto">code</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="document.body.innerHTML = '&lt;webview src=&quot;https://github.com&quot;&gt;&lt;/webview&gt;'
var webview = document.querySelector('webiview');
console.log(webview.getUrl()); // it works.

setInterval(function(){
  console.log(webview.getUrl()); // this causes crashing at display: none
}, 1000);
document.body.style.display = 'none';"><pre class="notranslate"><span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">.</span><span class="pl-c1">innerHTML</span> <span class="pl-c1">=</span> <span class="pl-s">'&lt;webview src="https://github.com"&gt;&lt;/webview&gt;'</span>
<span class="pl-k">var</span> <span class="pl-s1">webview</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">querySelector</span><span class="pl-kos">(</span><span class="pl-s">'webiview'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">webview</span><span class="pl-kos">.</span><span class="pl-en">getUrl</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// it works.</span>

<span class="pl-en">setInterval</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">webview</span><span class="pl-kos">.</span><span class="pl-en">getUrl</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// this causes crashing at display: none</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-c1">body</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">display</span> <span class="pl-c1">=</span> <span class="pl-s">'none'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">OS: Windows 8.1 x64<br>
Atom-Shell: 0.19</p>
<p dir="auto">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.</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;webview crash test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;webview id=&quot;web&quot; style=&quot;width:100%;height:100%;position:absolute;&quot;&gt;&lt;/webview&gt;
  &lt;script&gt;
    window.onload = function() {
      var web = document.getElementById(&quot;web&quot;);
      web.src = &quot;http://msn.com&quot;;
    };
  &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;"><pre class="notranslate"><span class="pl-c1">&lt;!DOCTYPE html<span class="pl-kos">&gt;</span></span>
<span class="pl-kos">&lt;</span><span class="pl-ent">html</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">head</span><span class="pl-kos">&gt;</span>
  <span class="pl-kos">&lt;</span><span class="pl-ent">title</span><span class="pl-kos">&gt;</span>webview crash test<span class="pl-kos">&lt;/</span><span class="pl-ent">title</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">head</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span>
  <span class="pl-kos">&lt;</span><span class="pl-ent">webview</span> <span class="pl-c1">id</span>="<span class="pl-s">web</span>" <span class="pl-c1">style</span>="<span class="pl-s">width:100%;height:100%;position:absolute;</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">webview</span><span class="pl-kos">&gt;</span>
  <span class="pl-kos">&lt;</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
    <span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-en">onload</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">var</span> <span class="pl-s1">web</span> <span class="pl-c1">=</span> <span class="pl-smi">document</span><span class="pl-kos">.</span><span class="pl-en">getElementById</span><span class="pl-kos">(</span><span class="pl-s">"web"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-s1">web</span><span class="pl-kos">.</span><span class="pl-c1">src</span> <span class="pl-c1">=</span> <span class="pl-s">"http://msn.com"</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">;</span>
  <span class="pl-kos">&lt;/</span><span class="pl-ent">script</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">body</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;/</span><span class="pl-ent">html</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">Reproduce the crash:</p>
<p dir="auto">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.</p>
<p dir="auto">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.</p>
<p dir="auto">Question, does calling display:none on the webview cause the webview to be garbage collected?</p>