T
T
Tenebrius2022-01-23 17:39:37
Node.js
Tenebrius, 2022-01-23 17:39:37

How to access a window in Electron from an attached script?

There is an application on Electron, updated from version 8 to 16.

Previously, you could access the window (to set the size and position) like this.

const {remote} = require('electron');
remote.getCurrentWindow();


As far as I understand, remote was once removed there.

How now correctly to get access to a window? Taking into account the fact that the window itself is created in main.js , and access is needed in the script.js script , which is included in index.html

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question