Skip to content

Preload script is not executed with newer electron versions. #7871

@JanisErdmanis

Description

@JanisErdmanis

Hello,

yesterday I started to learn javascript and electron with a target to add menu item which executes some command as argument taking a value from web page. Since I found app which does these things I started to learn from It. My issue is that for electron version larger than v0.37.0 my preload script does not gets executed.

I add to main.js prelaod script in this way

   mainWindow = new BrowserWindow({             // Instantiate the browser window.
        width: 1024,
        height: 768,
        preload: __dirname+'/preload.js'
    }); 

where in preload.js I simply add

console.log('preloading')

Is it a bug or I should load preload.js differently now?

  • Electron version: v1.4.5 and v0.37.0
  • Operating system: Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions