Skip to content

Commit

Permalink
fixup: register scheme privileges before app is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak1556 committed Jun 20, 2019
1 parent 12defe9 commit d814104
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const paths = require('./paths');
// @ts-ignore
const product = require('../product.json');
// @ts-ignore
const app = require('electron').app;
const { app, protocol } = require('electron');

// Enable portable support
const portable = bootstrap.configurePortable();
Expand All @@ -33,6 +33,11 @@ app.setPath('userData', userDataPath);
// Update cwd based on environment and platform
setCurrentWorkingDirectory();

// Register custom schemes with privileges
protocol.registerSchemesAsPrivileged([
{ scheme: 'vscode-resource', privileges: { secure: true, supportFetchAPI: true, corsEnabled: true } }
]);

// Global app listeners
registerListeners();

Expand Down
5 changes: 0 additions & 5 deletions src/vs/code/electron-main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ export class CodeApplication extends Disposable {
this.logService.debug(`from: ${this.environmentService.appRoot}`);
this.logService.debug('args:', this.environmentService.args);

// Register custom schemes with privileges
protocol.registerSchemesAsPrivileged([
{ scheme: 'vscode-resource', privileges: { secure: true, supportFetchAPI: true, corsEnabled: true } }
]);

// Make sure we associate the program with the app user model id
// This will help Windows to associate the running program with
// any shortcut that is pinned to the taskbar and prevent showing
Expand Down

0 comments on commit d814104

Please sign in to comment.