Electron preload scrip for webview not working?


#1

I maybe stupid but i’ve been looking for an anwser for the past 2 hours.

I have this webview that i load like this :

<webview id="link-view" src="http://url.espace.com/" preload="./preload.js" autosize="on" partition="persist:link"></webview>

In the preload.js file which is in the same directory i have this :

console.log("test");

This does not work, can somebody explain this to me ? :frowning:


#2

come on , nobody knows that ?


#3

Are you sure you see the output to console of webview, not of BrowserWindow?
Try replace console.log to alert


#4

I used alert instead, no alert poping … how can i look at the console of the webview , i’m looking both at the console of the renderer process and the main process ( terminal and devtool)

what am i doing wrong ?


#5

FOUND IT , i used electron boilerplate to load, and the preload.js wasnt involved in the gulpfile ! :smiley:


#6

Which bundler is the boilerplate using? I’m having a similar issue.