Contents

OpenDialogOptions

Options for opening a file open dialog.

Example 

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

const win = app.createWindow()
app.showOpenDialog({
  parentWindow: win,
  title: 'Open File',
  selectionPolicy: 'files',
  features: { allowMultiple: true }
})

Properties 

parentWindow 

readonly parentWindow?: BrowserWindow;

The parent window of the dialog. If provided, the dialog will be modal relative to the parent window. Otherwise, the dialog will be modal relative to the application.

title 

readonly title?: string;

The title of the dialog.

message 

readonly message?: string;

The message to be displayed above the input boxes on macOS.

buttonLabelOpen 

readonly buttonLabelOpen?: string;

The custom label for the dialog’s confirmation button.

defaultPath 

readonly defaultPath?: FilePath;

The path to the directory or file to select by default.

filters 

readonly filters?: FileFilter[];

The file filters to apply to the dialog.

selectionPolicy 

readonly selectionPolicy?: OpenDialogSelectionPolicy;

The policy for selecting items in the dialog. If not provided, the dialog will allow selecting only files. Default: ‘files’

features 

readonly features?: OpenDialogFeatures;

The features of the dialog that can be used to customize its behavior.