BrowserWindowOptions
Options for creating a new browser window.
Example
import { BrowserWindow } from '@mobrowser/api';
const win = new BrowserWindow({
size: { width: 800, height: 600 },
url: 'https://example.com'
})
win.show()
Properties
title
readonly title?: string;
The title of the window.
size
readonly size?: Size;
The window size.
Example
import { BrowserWindow } from '@mobrowser/api';
const win = new BrowserWindow({
size: { width: 800, height: 600 }
})
minimumSize
readonly minimumSize?: Size;
The window minimum size. By default, the minimum size of the window is 1x1.
Example
import { BrowserWindow } from '@mobrowser/api';
const win = new BrowserWindow({
minimumSize: { width: 200, height: 100 }
})
position
readonly position?: Point;
The window position.
alwaysOnTop
readonly alwaysOnTop?: boolean;
Whether the window should be always on top.
windowTitleVisible
readonly windowTitleVisible?: boolean;
Whether the window title is visible.
windowTitlebarVisible
readonly windowTitlebarVisible?: boolean;
Whether the window titlebar is visible.
windowDisplayPolicy
readonly windowDisplayPolicy?: WindowDisplayPolicy;
The display policy of the window accross multiple displays.
windowAnimationEnabled
readonly windowAnimationEnabled?: boolean;
Whether the window animation is enabled.
activationIndependenceEnabled
readonly activationIndependenceEnabled?: boolean;
Whether the user can interact with the always on top window without causing the application to be activated on macOS.
vibrancyEffect
readonly vibrancyEffect?: VibrancyEffect;
The vibrancy effect of the window on macOS.
windowButtonPosition
readonly windowButtonPosition?: Point;
The position of the traffic light buttons on the window titlebar on macOS.
Example
import { BrowserWindow } from '@mobrowser/api';
const win = new BrowserWindow({
windowButtonPosition: { x: 10, y: 10 }
})
### url
```ts
readonly url?: string;
The URL to load when the window is created.
It can be a remote URL (e.g., “https://example.com”), an absolute path
to a local file (e.g., “file:///path/to/file.html”), or the URL of
the application frontend entry point you can access via app.url.
Example
import { BrowserWindow } from '@mobrowser/api';
const win = new BrowserWindow({
url: 'https://example.com'
})
win.show()