requirejs - Electron - Issue Resolving Electron Modules In Renderer Process -
i having difficulty resolving electron modules in web application using electron v0.32.3 using require. understanding (although not clear in docs) modules supposed automatically available require of application being run in webview (examples include 'ipc' , 'remote'). can see there @ runtime, not sure how access them:
i feel there piece missing. other information: web application durandal 2x spa uses require load modules already. there other kind of setup required in render process requirejs config access these modules?
it turns out didn't understand of different processes going on. application using webview inside of browser-window, there 3 processes concerned about:
- main process - has access node
- renderer process (browser window) - has access node default
- web view process - not have access node default
i seeing node modules available 2) , trying use them in 3). webview has 'nodeintegration' attribute can used enable this: http://electron.atom.io/docs/v0.34.0/api/web-view-tag/#nodeintegration
however, using preload script allows exposing necessary node functionality using nodeintegration: http://electron.atom.io/docs/v0.34.0/api/web-view-tag/#preload
i went solution, setting communication between renderer process , webview process.
Comments
Post a Comment