目录

BrowserWindow

Extends: AbstractWindow<BrowserView>

An application window that displays content of a Browser instance associated with it.

import { BrowserWindow } from '@mobrowser/api';

Example 

import { app, BrowserWindow } from '@mobrowser/api';

const win = new BrowserWindow()
win.browser.loadUrl(app.url)
win.show()

Properties 

browser 

readonly browser: Browser;

The browser instance associated with the browser window.

Example 

import { BrowserWindow } from '@mobrowser/api';

const win = new BrowserWindow()
win.browser.loadUrl('https://example.com')
win.browser.on('titleChanged', (title) => {
  win.setTitle(title)
})
win.show()

Methods 

constructor() 

constructor(options?: BrowserWindowOptions): void;

Creates a new browser window with the given options.

ParameterTypeDescription
options?BrowserWindowOptionsThe options to use for creating the new browser window. If not provided, default options will be used.

Example 

import { app, BrowserWindow } from '@mobrowser/api';

const win = new BrowserWindow()
win.browser.loadUrl(app.url)
win.show()