|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information. |
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 |
|
6 | | -import { app, ipcMain as ipc, systemPreferences, shell, Event, contentTracing, protocol, powerMonitor, IpcMainEvent, BrowserWindow, dialog } from 'electron'; |
| 6 | +import { app, ipcMain as ipc, systemPreferences, shell, Event, contentTracing, protocol, powerMonitor, IpcMainEvent, BrowserWindow, dialog, session } from 'electron'; |
7 | 7 | import { IProcessEnvironment, isWindows, isMacintosh } from 'vs/base/common/platform'; |
8 | 8 | import { WindowsMainService } from 'vs/platform/windows/electron-main/windowsMainService'; |
9 | 9 | import { IWindowOpenable } from 'vs/platform/windows/common/windows'; |
@@ -129,7 +129,7 @@ export class CodeApplication extends Disposable { |
129 | 129 | } |
130 | 130 | }); |
131 | 131 |
|
132 | | - // Security related measures (https://electronjs.org/docs/tutorial/security) |
| 132 | + //#region Security related measures (https://electronjs.org/docs/tutorial/security) |
133 | 133 | // |
134 | 134 | // !!! DO NOT CHANGE without consulting the documentation !!! |
135 | 135 | // |
@@ -212,8 +212,14 @@ export class CodeApplication extends Disposable { |
212 | 212 |
|
213 | 213 | shell.openExternal(url); |
214 | 214 | }); |
| 215 | + |
| 216 | + session.defaultSession.setPermissionRequestHandler((webContents, permission /* 'media' | 'geolocation' | 'notifications' | 'midiSysex' | 'pointerLock' | 'fullscreen' | 'openExternal' */, callback) => { |
| 217 | + return callback(false); |
| 218 | + }); |
215 | 219 | }); |
216 | 220 |
|
| 221 | + //#endregion |
| 222 | + |
217 | 223 | let macOpenFileURIs: IWindowOpenable[] = []; |
218 | 224 | let runningTimeout: NodeJS.Timeout | null = null; |
219 | 225 | app.on('open-file', (event: Event, path: string) => { |
|
0 commit comments