add mic/cam access
This commit is contained in:
parent
8d18437dfa
commit
7198b136a6
1 changed files with 7 additions and 2 deletions
9
main.js
9
main.js
|
@ -1,5 +1,5 @@
|
|||
// Modules to control application life and create native browser window
|
||||
const {app, BrowserWindow, session, ipcMain} = require('electron')
|
||||
const {app, BrowserWindow, session, ipcMain, systemPreferences} = require('electron')
|
||||
const path = require('path')
|
||||
const fetch = require("cross-fetch")
|
||||
const { ElectronChromeExtensions } = require('electron-chrome-extensions')
|
||||
|
@ -9,6 +9,8 @@ const fs = require('fs');
|
|||
const { createProxy } = require('proxy');
|
||||
const buildChromeContextMenu = require('electron-chrome-context-menu').default
|
||||
var extensions
|
||||
var mic
|
||||
var cam
|
||||
app.on('web-contents-created', (event, webContents) => {
|
||||
webContents.on('context-menu', (e, params) => {
|
||||
const menu = buildChromeContextMenu({
|
||||
|
@ -224,10 +226,11 @@ app.on('window-all-closed', function () {
|
|||
if (process.platform !== 'darwin') { app.quit() }
|
||||
})
|
||||
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
// Set DNS
|
||||
// Set DNS and enable mic/cam
|
||||
app.on('ready', () => {
|
||||
app.configureHostResolver({
|
||||
mode: 'secure',
|
||||
|
@ -236,4 +239,6 @@ app.on('ready', () => {
|
|||
'https://cloudflare-dns.com/dns-query'
|
||||
]
|
||||
});
|
||||
mic = systemPreferences.askForMediaAccess('microphone');
|
||||
cam = systemPreferences.askForMediaAccess('camera');
|
||||
});
|
Loading…
Reference in a new issue