Monday, 14 September 2020

Preload scripts not being executed in webview iframes

Webview tag that is present in the renderer process, somewhere in <body>:

<webview src="http://somewebpage.com" preload="somescript.js">

somescript.js is executed in somewebpage, but if somewebpage has <iframe>s in it, the script will not run in the iframe.

How can I make it run? And before any other script in the iframe?

I found this issue on github that seems related: https://github.com/electron/electron/pull/19260 but it doesn't make any sense...

I tried adding nodeintegrationinsubframes and changing values from false to true

<webview src="somewebpage" preload="somescript.js" nodeintegrationinsubframes="false">

but it has no effect :(



from Preload scripts not being executed in webview iframes

No comments:

Post a Comment