@electron/remote's getCurrentWindow doesn't return the full window object

374 views Asked by At

When using @electron/remote, the results of remote.getCurrentWindow() lack all the additional properties/methods of the window that are accessible from the main process, and used to be accessible when using remote.getCurrentWindow() with the built-in remote. For example:

@electron/remote

  const remote = require('@electron/remote');
  console.log(remote.getCurrentWindow().isFullScreen); // undefined

original remote module

  const { remote } = require('electron');
  console.log(remote.getCurrentWindow().isFullScreen); // true/false

What's the reason for this difference in behavior? It's not documented anywhere that I could find.

1

There are 1 answers

1
Thearcane On

Put nodeIntegration: true contextIsolation: false in webPreferences of mainWindow. May be this can be the problem.