Contents

AlertParams

Parameters for the alert dialog.

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

Example 

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

const win = app.createWindow()
win.browser.handle('alert', async (params: AlertParams) => {
  await app.showMessageDialog({
    parentWindow: win,
    title: params.title,
    message: params.message,
    buttons: [{ label: params.labelOk, type: 'primary' }]
  })
  return 'ok'
})

Properties 

url 

readonly url: string;

The URL of the page that requested the dialog.

title 

readonly title: string;

The localized dialog title.

message 

readonly message: string;

The message passed to the window.alert() JavaScript function.

labelOk 

readonly labelOk: string;

The localized label for the “OK” button.