目录

RequestPermissionsParams

Parameters for a permission request.

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

Example 

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

const win = new BrowserWindow()
win.browser.handle('requestPermissions', async (params: RequestPermissionsParams) => {
  if (params.permissionType === 'notifications') {
    return 'grant'
  }
  return 'deny'
})

Properties 

permissionType 

readonly permissionType: string;

The type of permission requested (e.g., ’notifications’, ‘geolocation’).

url 

readonly url: string;

The URL of the web page requesting the permission.

browser 

readonly browser: Browser;

The browser instance requesting the permission.