tamkeen-tms / electron-window-manager

A NodeJs module that handles window management for Electron (Atom Shell, previously).
MIT License
397 stars 65 forks source link

annot find module 'remote' #73

Open candelariajr opened 5 years ago

candelariajr commented 5 years ago

Using this code :

I keep getting the following: Cannot find module 'remote'

nikoc2016 commented 5 years ago

I am having the same problem too, so far I find out that normally when you start a window, you have webPreference{nodeIntegeration:true} in setup so you can use node code like "require" in html. However, the webpreference is unable to setup by using electron-window-manager.

Cabeccar commented 5 years ago

In your Main.js or electron.js use this:

windowManager.open('window Name', 'window title', 'window path',false, {'width': 900, 'height': 600, webPreferences: { nodeIntegration: true }});

Then, in the new created window you can call this:

const remote = require('electron').remote; const windowManager = remote.require('electron-window-manager');

yuema96 commented 2 years ago

it still does not work for me~@Cabeccar

yuema96 commented 2 years ago

I am able to create a main window, but it does not work for my second window