Webview only displays when devTools is open


#1

I’m trying to do something simple: I need a layer of HTML above an existing app to add things like notifications and a toolbar.

I’m doing this by including a webview which points to my original app.

Is this the right idea?

What I see is that the webview doesn’t render unless devTools is open. Strange!

Please tell me what I’m doing wrong. I’m suspecting I need to be listening for an event and doing something smart.

Super-simple testcase here.


#2

Even weirder…

this doesn’t work:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Browser</title>
  </head>
  <body>
    <webview src="./content/index.html" >
    </webview>
  </body>
</html>

But add <script></script> after the webview and it does:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Browser</title>
  </head>
  <body>
    <webview src="./content/index.html" >
    </webview>
  <script>
  </script>
  </body>
</html>

When it doesn’t work, when I open the dev tools I can see the webview src=./content/index.html. But when I refresh, with dev tools open, this changes to src=file://my_dir/content/index.html. Is this a Chromium bug maybe?


#3

I think this is the same problem reported here:


#4

Ah, beaut, thanks so much John. Validation! I like when it’s not my fault.