# Windows

Any kind of actions relating to managing a [window](https://www.electronjs.org/docs/latest/api/browser-window) or it's lifecycle. This also includes properties of the window's [web contents](https://www.electronjs.org/docs/latest/api/web-contents). In Electron's docs, these are separate modules. However, in our adaptation, these are combined for simplicity.\
\
At least one window must exist at all times. If all windows are closed/become unresponsive, the app will close. For apps intended to be background apps, consider using the skipTaskbar property.

## Methods

### <mark style="color:purple;">Create Window</mark>

Creates a new window.

{% tabs %}
{% tab title="JavaScript" %}
{% code overflow="wrap" %}

```javascript
await window.deskifier.windows.create({ arguments })
```

{% endcode %}

**Arguments**

* `constructorOptions` [<mark style="color:blue;">Deskifier.constructorOptions</mark>](#constructoroptions) — see the [constructorOptions](#constructoroptions) object below
* `windowProperties` [<mark style="color:blue;">Deskifier.windowProperties</mark>](#windowproperties) — see the [windowProperties](#windowproperties) object below

**Returns**

* `windowId` <mark style="color:green;">String</mark>
* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.

**Example**

{% code overflow="wrap" %}

```javascript
const constructorOptions = {
    url: "https://www.deskifier.com",
    show: false,
    center: true,
    frame: false
};
const windowProperties = {
    resizable: true,
    width: 800, 
    height: 600,
    alwaysOnTop: true,
    title: "Fresh Window"
};


const result = await window.deskifier.windows.create({
  constructorOptions,
  windowProperties,
});

console.log(result.windowId);  // "window-2"
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

### <mark style="color:purple;">Update Window Properties</mark>

Updates the window properties.

{% hint style="info" %}
**Note**: Fields are optional. Only properties that are provided will be updated; omitted properties will remain unchanged.
{% endhint %}

{% tabs %}
{% tab title="JavaScript" %}
{% code overflow="wrap" %}

```javascript
await window.deskifier.windows.updateProperties({ arguments })
```

{% endcode %}

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.
* `windowProperties` [<mark style="color:blue;">Deskifier.windowProperties</mark>](#windowproperties) — see the [windowProperties](#windowproperties) object below

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.

**Example**

{% code overflow="wrap" %}

```javascript
const options = {
    resizable: true,
    width: 800, 
    height: 600,
    alwaysOnTop: true,
    title: "Updated Window"
};


const result = await window.deskifier.windows.updateProperties({
  windowId: "window-1",
  windowProperties: options,
});

console.log(result.success);  // true
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

### <mark style="color:purple;">Destroy Window</mark>

Destroys the window. If this is the only window open, the app will close. If you wish to continue running in the background, you should hide the window and skip the taskbar.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.destroy({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Center Window</mark>

Centers the window in the middle of the screen.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.center({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Focus Window</mark>

Focuses on the window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.focus({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Blur Window</mark>

Unfocuses the window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.blur({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Show Window</mark>

Shows and gives focus to the window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.show({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Hide Window</mark>

Hides the window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.hide({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Maximize Window</mark>

Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.maximize({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Unmaximize Window</mark>

Unmaximizes the window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.unmaximize({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Minimize Window</mark>

Minimizes the window. On some platforms the minimized window will be shown in the Dock.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.minimize({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Restore Window</mark>

Restores the window from minimized state to its previous state.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.restore({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Reload Web Contents</mark>

Reloads the current web contents.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.reload({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Toggle Dev Tools</mark>

Show/hide the dev tools.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.toggleDevTools({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.
* `show` <mark style="color:green;">Boolean</mark> (Required)

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Navigate Back</mark>

Goes back a page, if possible.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.navigateBack({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Navigate Forward</mark>

Goes forward a page, if possible.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.navigateForward({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Execute JavaScript</mark>

Executes JavaScript in the specified window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.executeJavaScript({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Required)
* `code` <mark style="color:green;">String</mark> (Required)

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Start Drag</mark>

Sets the dragging item for the current drag-drop operation.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.startDrag({ arguments })
```

**Arguments**

* `filePaths` Array of <mark style="color:green;">Strings</mark>\
  The paths to the files being dragged. Can be a single file path, or multiple.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Send Window Message</mark>

Sends a custom message that can be received by another window. This will fire the ['windowMessageReceived'](#window-message-received) event in the target window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.sendMessage({ arguments })
```

**Arguments**

* `toWindowId` <mark style="color:green;">String</mark> (Required)
* `message` <mark style="color:green;">String</mark> (Required)

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
  {% endtab %}
  {% endtabs %}

***

## Properties

### <mark style="color:purple;">Get All Window IDs</mark>

Returns all available window IDs

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.getAllIds()
```

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `windowIds` Array Of <mark style="color:green;">Strings</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Get Window Properties</mark>

Returns an object with the current state of the window.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.getProperties({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `windowProperties` [<mark style="color:blue;">Deskifier.WindowProperties</mark>](#window-properties)
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Get Web Contents Properties</mark>

Returns an object with details about the window's web contents object.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await window.deskifier.windows.getWebContentsProperties({ arguments })
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark> (Optional)\
  Defaults to the current window.

**Returns**

* `success` <mark style="color:green;">Boolean</mark>\
  If the action was successful.
* `message` <mark style="color:green;">String</mark>\
  Additional confirmation, or error details if action was unsuccessful.
* `webContents` [<mark style="color:blue;">Deskifier.webContentsProperties</mark>](#webcontentsproperties)
  {% endtab %}
  {% endtabs %}

***

## Events

### <mark style="color:purple;">Window Closed</mark>

Emitted when a window is closed.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onClosed((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>

**Example**

```javascript
window.deskifier.windows.onClosed((data) => {
   console.log(data.windowId);
});

//2
```

{% endtab %}
{% endtabs %}

***

### <mark style="color:purple;">Window Close Attempt</mark>

Emitted when a user attempts to close a window, but the window is not closable.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onCloseAttempt((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Unresponsive</mark>

Emitted when a window's webpage becomes unresponsive.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onUnresponsive((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Responsive</mark>

Emitted when a window's webpage becomes responsive again.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onResponsive((data) => {})
```

{% endtab %}
{% endtabs %}

***

### <mark style="color:purple;">Window Blurred</mark>

Fires when a browser window is unfocused.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onBlurred((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Focused</mark>

Fires when a browser window is focused.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onFocused((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Shown</mark>

Fires when a browser window is shown.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onShown((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Hidden</mark>

Fires when a browser window is hidden.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onHidden((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Ready To Show</mark>

Fires when a browser window is loaded, and rendered. Use this to show a window gracefully.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onReadyToShow((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Maximized</mark>

Fires when a browser window is maximized.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onMaximized((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Unmaximized</mark>

Fires when a browser window is unmaximized.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onUnmaximized((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Minimized</mark>

Fires when a browser window is minimized.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onMinimized((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Restored</mark>

Fires when a browser window is restored.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onRestored((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Resized</mark>

Fires when a browser window is resized.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onResized((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Moved</mark>

Fires when a browser window is moved.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onMoved((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Entered Fullscreen</mark>

Fires when a browser window enters fullscreen mode.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onEnteredFullscreen((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Left Fullscreen</mark>

Fires when a browser window leaves fullscreen.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onLeftFullscreen((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Entered HTML Fullscreen</mark>

Fires when a window enters a full-screen state triggered by HTML API.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onEnteredHTMLFullscreen((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Left HTML Fullscreen</mark>

Fires when a window leaves a full-screen state triggered by HTML API.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onLeftHTMLFullscreen((data) => {})
```

**Arguments**

* `windowId` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Window Message Received</mark>

Fires when a message is received from another window. Send a message with the '[Send Window Message](#send-window-message)' method.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onMessageReceived((data) => {})
```

**Arguments**

* `fromWindowId` <mark style="color:green;">String</mark>\
  The window ID that generated the message.
* `toWindowId` <mark style="color:green;">String</mark>\
  The window ID that the message was sent to.
* `message` <mark style="color:green;">String</mark>
  {% endtab %}
  {% endtabs %}

***

### <mark style="color:purple;">Files Dropped</mark>

Fires when one or more external files are dropped onto the window via the secure drag-and-drop overlay. The `paths` array contains absolute paths to the dropped files, which are automatically added to the app's filesystem access allowlist so you can read them immediately.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
window.deskifier.windows.onFilesDropped((data) => {})
```

**Arguments**

* `paths` Array of <mark style="color:green;">Strings</mark>\
  Absolute paths to the files that were dropped.

**Example**

{% code overflow="wrap" %}

```javascript
window.deskifier.windows.onFilesDropped(async (data) => {
  for (const path of data.paths) {
    const { content } = await window.deskifier.filesystem.readFile({ path });
    console.log(path, content.length, 'bytes');
  }
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

***

## Objects

### <mark style="color:purple;">windowProperties</mark>

* `width` <mark style="color:green;">Number</mark>\
  Width in px. Default is `800`.
* `height` <mark style="color:green;">Number</mark>\
  Height in px. Default is `600`.
* `x` <mark style="color:green;">Number</mark>\
  (**required** if y is used) Window's left offset from screen. Default is to center the window.
* `y` <mark style="color:green;">Number</mark>\
  (**required** if x is used) Window's top offset from screen. Default is to center the window.
* `center` <mark style="color:green;">Boolean</mark>\
  Centers the window on screen. Only takes effect when `x`/`y` are not provided.
* `minWidth` <mark style="color:green;">Number</mark>\
  Window's minimum width. Default is `0`.
* `minHeight` <mark style="color:green;">Number</mark>\
  Window's minimum height. Default is `0`.
* `maxWidth` <mark style="color:green;">Number</mark>\
  Window's maximum width. Default is no limit.
* `maxHeight` <mark style="color:green;">Number</mark>\
  Window's maximum height. Default is no limit.
* `resizable` <mark style="color:green;">Boolean</mark>\
  Controls if the window is resizable.
* `movable` <mark style="color:green;">Boolean</mark> ***macOS*** ***Windows***\
  Controls if the window can be moved by the user. On Linux does nothing.
* `minimizable` <mark style="color:green;">Boolean</mark> ***macOS*** ***Windows***\
  Controls if the window can be minimized. On Linux does nothing.
* `maximizable` <mark style="color:green;">Boolean</mark> ***macOS*** ***Windows***\
  Controls if the window can be maximized. On Linux does nothing.
* `closable` <mark style="color:green;">Boolean</mark> ***macOS*** ***Windows***\
  Sets if the window can be closed by the user. On Linux does nothing.
* `interceptClose` <mark style="color:green;">Boolean</mark>\
  When `true`, user-initiated close attempts fire the [`windowCloseAttempt`](#window-close-attempt) event instead of actually closing the window. Useful for showing a "save before closing?" prompt. Default is `false`.
* `alwaysOnTop` <mark style="color:green;">Boolean</mark>\
  Sets the window to stay on top of other windows.
* `fullscreen` <mark style="color:green;">Boolean</mark>\
  Whether the window should show in fullscreen. When explicitly set to `false` the fullscreen button will be hidden or disabled on macOS. Default is `false`.
* `fullscreenable` <mark style="color:green;">Boolean</mark>\
  Whether the window can be put into fullscreen mode. On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. Default is `true`.
* `maximized` <mark style="color:green;">Boolean</mark>\
  Whether the window is maximized. Setting to `true` maximizes the window; setting to `false` unmaximizes it.
* `skipTaskbar` <mark style="color:green;">Boolean</mark> ***macOS*** ***Windows*** (Optional)\
  Makes the window not show in the taskbar/dock. `false` by default.
* `kiosk` <mark style="color:green;">Boolean</mark>\
  Whether the window is in kiosk mode. Default is `false`.
* `show` <mark style="color:green;">Boolean</mark>\
  When passed as `true` via `updateWindowProperties`, shows the window. For full show/hide control, use the dedicated [`showWindow`](#show-window) and [`hideWindow`](#hide-window) methods. *(Not to be confused with the read-only `isVisible`.)*
* `title` <mark style="color:green;">String</mark>\
  Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded, this property will be ignored.
* `backgroundColor` <mark style="color:green;">String</mark>\
  Sets the window’s background color, in hex (e.g., #FFFFFF).
* `hasShadow` <mark style="color:green;">Boolean</mark>\
  Whether window should have a shadow. Default is `true`.
* `opacity` <mark style="color:green;">Number</mark> ***macOS*** ***Windows***\
  Sets window transparency, range 0.0 (fully transparent) to 1.0 (fully opaque).
* `ignoreMouseEvents` <mark style="color:green;">Boolean</mark>\
  Ignores or allows mouse events. `false` by default.
* `forwardMouseEvents` <mark style="color:green;">Boolean</mark> ***macOS*** ***Windows***\
  When `ignoreMouseEvents` is enabled, allows mouse events to be forwarded to underlying elements, to detect events like mouseEnter and mouseLeave. `false` by default.
* `visibleOnAllWorkspaces` <mark style="color:green;">Boolean</mark> ***macOS Linux*** (Optional)\
  Set if the window will show up across all workspaces. Useful for utility applications & floating windows. `false` by default.
* `trafficLightVisibility` <mark style="color:green;">Boolean</mark> ***macOS*** (Optional)\
  Set if the traffic lights should be visible.
* `trafficLightPosition` [<mark style="color:blue;">Point</mark>](https://www.electronjs.org/docs/latest/api/structures/point) ***macOS***\
  Repositions the traffic light buttons at runtime. Requires the window was created with `titleBarStyle: 'hidden'` or `presetTitleBar: 'Custom Overlay'`.
  * `x` <mark style="color:green;">Number</mark>
  * `y` <mark style="color:green;">Number</mark>
* `titleBarOverlay` <mark style="color:green;">Object</mark> ***Windows*** ***Linux***\
  Updates the Window Controls Overlay colors and height at runtime. Requires the window was created with `titleBarStyle: 'hidden'` and the overlay enabled (e.g., via `presetTitleBar: 'Overlay'`).
  * `color` <mark style="color:green;">String</mark>\
    The CSS color of the overlay.
  * `symbolColor` <mark style="color:green;">String</mark> ***Windows***\
    The CSS color of the button symbols.
  * `height` <mark style="color:green;">Number</mark>\
    Height of the title bar in pixels.
* `vibrancy` <mark style="color:green;">String</mark> ***macOS***\
  Applies a translucent vibrancy (blur) material to the window background. Possible values: `'appearance-based'`, `'light'`, `'dark'`, `'titlebar'`, `'selection'`, `'menu'`, `'popover'`, `'sidebar'`, `'medium-light'`, `'ultra-dark'`, `'header'`, `'sheet'`, `'window'`, `'hud'`, `'fullscreen-ui'`, `'tooltip'`, `'content'`, `'under-window'`, `'under-page'`. Pass `null` to remove.
* `backgroundMaterial` <mark style="color:green;">String</mark> ***Windows 11***\
  Applies a backdrop material to the window. Possible values: `'auto'`, `'none'`, `'mica'`, `'acrylic'`, `'tabbed'`. Has no effect on Windows 10, macOS, or Linux.
* `isMinimized` <mark style="color:green;">Boolean</mark>\
  If the window is currently minimized. ***Read only.***
* `isMaximized` <mark style="color:green;">Boolean</mark>\
  If the window is currently maximized. ***Read only.***
* `isNormal` <mark style="color:green;">Boolean</mark>\
  Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode). ***Read only.***
* `isFocused` <mark style="color:green;">Boolean</mark>\
  Whether the window is focused. ***Read only.***
* `isVisible` <mark style="color:green;">Boolean</mark>\
  Whether the window is visible to the user in the foreground of the app. ***Read only.***
* `id` <mark style="color:green;">String</mark>\
  The window's ID. ***Read only.***

### <mark style="color:purple;">constructorOptions</mark>

* `url` <mark style="color:green;">String</mark> (Required)
* `windowId` <mark style="color:green;">String</mark>\
  The window ID of the new window. Must be unique. If a value is not given, one will be generated.
* `show` <mark style="color:green;">Boolean</mark>\
  Whether to show the window. It's recommended to set this to false, and wait for the `ready-to-show` event before showing. Default is `true`.
* `showAfterLoading` <mark style="color:green;">Boolean</mark>\
  If `true`, the window stays hidden until its content finishes loading, then shows automatically. Overrides `show` internally. Default is `false`.
* `center` <mark style="color:green;">Boolean</mark>\
  Show window in the center of the screen. Default is `false`.
* `frame` <mark style="color:green;">Boolean</mark>\
  Specify `false` to create a [<mark style="color:$primary;">fra</mark>meless window](https://www.electronjs.org/docs/latest/tutorial/custom-window-styles). Default is `true`.
* `transparent` <mark style="color:green;">Boolean</mark>\
  Makes the window [<mark style="color:$primary;">transparent</mark>](https://www.electronjs.org/docs/latest/tutorial/window-customization#create-transparent-windows). Default is `true`. On Windows, does not work unless the window is frameless. Note, this is not the same as the `opacity` property.
* `presetTitleBar` <mark style="color:green;">String</mark>\
  A high-level title bar preset. When set, **overrides** `frame`, `titleBarStyle`, `titleBarOverlay`, and `trafficLightPosition`. Possible values:
  * `Window Frame` — standard OS frame and title bar. *(default behavior)*
  * `None` — frameless window with no title bar and no window controls.
  * `Overlay` — hidden title bar. On **macOS** shows the standard traffic lights; on **Windows**/**Linux** activates the Window Controls Overlay with default colors. You can still provide `titleBarOverlay` to customize button colors on Windows/Linux.
  * `Overlay Inset` ***macOS*** — hidden title bar with traffic lights slightly inset from the window edge.
  * `Custom Overlay` — frameless, hidden title bar, no Window Controls Overlay. Use when rendering your own title bar. On macOS, reposition the traffic lights with `trafficLightPosition`.
* `titleBarStyle` <mark style="color:green;">String</mark>\
  The style of window title bar. Default is `default`. Possible values are:
  * `default` - Results in the standard title bar for macOS or Windows respectively.
  * `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows and Linux, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
  * `hiddenInset` ***macOS*** - Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
* `titleBarOverlay` <mark style="color:green;">Object</mark> ***Windows*** ***Linux*** (Optional)\
  This property enables the Window Controls Overlay [JavaScript APIs](https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#javascript-apis) and [CSS Environment Variables](https://github.com/WICG/window-controls-overlay/blob/main/explainer.md#css-environment-variables). This only works if the window is frameless.
  * `color` <mark style="color:green;">String</mark> (Optional)\
    The CSS color of the Window Controls Overlay when enabled. Default is the system color.
  * `symbolColor` <mark style="color:green;">String</mark> ***Windows*** (Optional)\
    The CSS color of the symbols on the Window Controls Overlay when enabled. Default is the system color.
  * `height` <mark style="color:green;">Number</mark> (Optional)\
    The height of the title bar and Window Controls Overlay in pixels. Default is system height.
* `trafficLightPosition` [<mark style="color:blue;">Point</mark>](https://www.electronjs.org/docs/latest/api/structures/point) ***macOS***
  * `x` <mark style="color:green;">Number</mark>
  * `y` <mark style="color:green;">Number</mark>

{% hint style="info" %}
Read more about these settings in our [Style Guide](broken://pages/GGtjpzc2cW5tZvm6lDQG).
{% endhint %}

### <mark style="color:purple;">webContentsProperties</mark>

* `devToolsOpen` <mark style="color:green;">Boolean</mark>\
  If the developer tools are currently open.
* `zoomLevel` <mark style="color:green;">Number</mark>\
  Current zoom level.
* `url` <mark style="color:green;">String</mark>\
  Current URL loaded in the window.
* `title` <mark style="color:green;">String</mark>\
  Document title of the current page.
* `loading` <mark style="color:green;">Boolean</mark>\
  If the page is currently loading.
* `canNavigateBack` <mark style="color:green;">Boolean</mark>\
  If there is a previous page in the history.
* `canNavigateForward` <mark style="color:green;">Boolean</mark>\
  If there is a next page in the history.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deskifier.gitbook.io/deskifier/readme-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
