electron/docs/fiddles/features/web-bluetooth/preload.js
John Kleinschmidt 6a6908c4c8
fix: allow cancelling of bluetooth requests (#37601)
* fix: allow cancelling of bluetooth requests

allows cancelling of bluetooth requests when no devices present

* docs: update docs to reflect how bluetooth works.
2023-03-27 09:31:15 -04:00

7 lines
No EOL
402 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('electronAPI', {
cancelBluetoothRequest: (callback) => ipcRenderer.send('cancel-bluetooth-request', callback),
bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
})