Contents

ConfirmParams

Parameters for the confirm dialog.

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

Example 

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

const win = app.createWindow()
win.browser.handle('confirm', async (params: ConfirmParams) => {
  const result = await app.showMessageDialog({
    parentWindow: win,
    title: params.title,
    message: params.message,
    buttons: [
      { label: params.labelCancel, type: 'secondary' },
      { label: params.labelOk, type: 'primary' }
    ]
  })
  return result.button.type === 'primary' ? 'ok' : 'cancel'
})

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.confirm() JavaScript function.

labelOk 

readonly labelOk: string;

The localized label for the “OK” button.

labelCancel 

readonly labelCancel: string;

The localized label for the “Cancel” button.