目录

BaseWindow

Extends: AbstractWindow<View>

A native window that owns a tree of child views.

Example 

import { BaseWindow, BrowserView } from '@mobrowser/api';

const win = new BaseWindow({
  title: 'Split view',
  size: { width: 1000, height: 640 }
})

const left = new BrowserView({
  url: 'https://example.com/left'
})
const right = new BrowserView({
  url: 'https://example.com/right'
})

win.contentView.addChildView(left)
win.contentView.addChildView(right)

left.setBounds({
  origin: { x: 0, y: 0 },
  size: { width: 500, height: 640 }
})
right.setBounds({
  origin: { x: 500, y: 0 },
  size: { width: 500, height: 640 }
})

win.show()

Methods 

constructor() 

constructor(options?: BaseWindowOptions): void;

Creates a new base window with the given options.

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

Example 

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

const win = new BaseWindow({
  title: 'Untitled',
  size: { width: 800, height: 600 }
})
win.show()