Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

electron-update-window-options

ocboogie12MIT1.1.1TypeScript support: included

Update an electron window after it's already been created using the constructor options schema

electron, browser window, window, settings, options, update

readme

electron-update-window-options

This library allows you to update an electron window after it's already been created using the constructor options schema.

updateWindowOptions(browserWindow, { movable: false });

is the same as

new BrowserWindow({ movable: false });

But you can use this function after it's created

Examples/Usage

const { BrowserWindow, app } = require("electron");
const updateWindowOptions = require("electron-update-window-options");

app.on("ready", () => {
  const browserWindow = new BrowserWindow({ movable: true });

  browserWindow.setMovable(false);
  // Is the same as
  updateWindowOptions(browserWindow, { movable: false });
  // But this is the same format as
  // new BrowserWindow(/* this */);
});