Session.setPermissionRequestHandler method
Session › setPermissionRequestHandler
Unofficial
Sets the handler used to respond to permission requests for the session.Signature:
setPermissionRequestHandler(handler: ((webContents: ElectronWebContents, permission: "clipboard-read" | "display-capture" | "fullscreen" | "geolocation" | "media" | "mediaKeySystem" | "midi" | "midiSysex" | "notifications" | "openExternal" | "pointerLock" | "unknown", callback: (permissionGranted: boolean) => void, details: ElectronPermissionRequestHandlerHandlerDetails) => void) | null): voidParameters:
| Parameter | Type | Description |
|---|---|---|
| handler | ((webContents: ElectronWebContents, permission: "clipboard-read" | "display-capture" | "fullscreen" | "geolocation" | "media" | "mediaKeySystem" | "midi" | "midiSysex" | "notifications" | "openExternal" | "pointerLock" | "unknown", callback: (permissionGranted: boolean) => void, details: ElectronPermissionRequestHandlerHandlerDetails) => void) | null | The handler invoking the callback to allow or reject the permission, or null to clear it. |
Returns: void