Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annot find module 'remote' #73

Open
candelariajr opened this issue Apr 22, 2019 · 4 comments
Open

annot find module 'remote' #73

candelariajr opened this issue Apr 22, 2019 · 4 comments

Comments

@candelariajr
Copy link

Using this code :

<script> var remote = require('remote'); var windowManager = remote.require('electron-window-manager'); // Create a new window var win2 = windowManager.createNew('win2', 'Windows #2'); win2.setURL('/window2.html'); win2.onReady({}); win2.open(); </script>

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

@nikoc2016
Copy link

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
Copy link

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
Copy link

yuema96 commented Jun 27, 2022

it still does not work for me~@Cabeccar

@yuema96
Copy link

yuema96 commented Jun 27, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants