Webview not rendering content


#1

Hi,

I’m just starting to use Electron, and I am wanting to build a composite application out of seperate web applications that run in Electron webviews that communicate via IPC.

To start with I have just tried working through a very basic ‘hello world’ style webview, identical to the one from the docs

The problem I have run into is that the webview won’t load except under a specific circumstance. If the view my BrowserWindow loads is structured like so:

<!DOCTYPE html>
<html>
<head>
    <title>X</title>
    <script>
    </script>
</head>
<body>
    <webview id="foo" src="https://www.github.com/" style="width:640px; height:480px" disablewebsecurity allowfileaccessfromfiles></webview>
</body>
</html>

The webview loads the content from github.com as expected. However if I remove the empty script tag from the header like so:

<!DOCTYPE html>
<html>
<head>
    <title>X</title>
</head>
<body>
    <webview id="foo" src="https://www.github.com/" style="width:640px; height:480px" disablewebsecurity allowfileaccessfromfiles></webview>
</body>
</html>

It does not load. I have scoured this forum and the web for answers but have come up with nothing.

One other symptom I have noticed is that when it does work, I can see two seperate “Renderer process started” information messages emitted, from two seperate process Id’s. When it does not work, I only see a single “Renderer process started” message emitted.

I have pushed up a branch of my work in progress where this behaviour can be reproduced.

Any help would be greatly appreciated.


#2

Can you supply the following information:

  • What version of electron are you using?
  • What version of what OS are you using?

If I remember correctly, the webview had this bug and it was fixed in Electron 0.27.2


#3
  • I am using electron ^0.27.2 (via electron-prebuilt package)
  • I am using Windows 8.1 x64

Thanks for the reply, sorry for not including this information in my original post.