mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-06 15:45:54 +01:00
comments 💄
This commit is contained in:
@@ -571,7 +571,7 @@ export class CodeApplication extends Disposable {
|
||||
private setupProtocolUrlHandlers(accessor: ServicesAccessor, mainProcessElectronServer: ElectronIPCServer): IInitialProtocolUrls | undefined {
|
||||
const windowsMainService = this.windowsMainService = accessor.get(IWindowsMainService);
|
||||
const urlService = accessor.get(IURLService);
|
||||
const nativeHostMainService = accessor.get(INativeHostMainService);
|
||||
const nativeHostMainService = this.nativeHostMainService = accessor.get(INativeHostMainService);
|
||||
|
||||
// Install URL handlers that deal with protocl URLs either
|
||||
// from this process by opening windows and/or by forwarding
|
||||
@@ -603,20 +603,19 @@ export class CodeApplication extends Disposable {
|
||||
private resolveInitialProtocolUrls(): IInitialProtocolUrls | undefined {
|
||||
|
||||
/**
|
||||
* Protocol URL handling on startup is complex,
|
||||
* refer to {@link IInitialProtocolUrls} for an
|
||||
* explainer.
|
||||
* Protocol URL handling on startup is complex, refer to
|
||||
* {@link IInitialProtocolUrls} for an explainer.
|
||||
*/
|
||||
|
||||
// Windows/Linux: protocol handler invokes CLI with --open-url
|
||||
const protocolUrlsFromCommandLine = this.environmentMainService.args['open-url'] ? this.environmentMainService.args._urls || [] : [];
|
||||
if (protocolUrlsFromCommandLine.length) {
|
||||
if (protocolUrlsFromCommandLine.length > 0) {
|
||||
this.logService.trace('app#resolveInitialProtocolUrls() protocol urls from command line:', protocolUrlsFromCommandLine);
|
||||
}
|
||||
|
||||
// macOS: open-url events that were received before the app is ready
|
||||
const protocolUrlsFromEvent = ((<any>global).getOpenUrls() || []) as string[];
|
||||
if (protocolUrlsFromEvent.length) {
|
||||
if (protocolUrlsFromEvent.length > 0) {
|
||||
this.logService.trace(`app#resolveInitialProtocolUrls() protocol urls from macOS 'open-url' event:`, protocolUrlsFromEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,11 @@ export interface IProtocolUrl {
|
||||
* form of the protocol URL:
|
||||
*
|
||||
* On the high level, there are 2 types of protocol URLs:
|
||||
* - those that need to be handled within a window for
|
||||
* example because they need to be forwarded to an
|
||||
* extension
|
||||
* - those that need to be handled within a window because
|
||||
* they need to be forwarded to an extension for example
|
||||
* - those that can be handled directly as window to open
|
||||
*
|
||||
* The former are for example of the form:
|
||||
* The former can be of the form:
|
||||
* ```
|
||||
* <protocol>://<extension.id>/<path>
|
||||
* ```
|
||||
|
||||
@@ -68,11 +68,11 @@ export class RelayURLService extends NativeURLService implements IURLHandler, IO
|
||||
const result = await super.open(uri, options);
|
||||
|
||||
if (result) {
|
||||
this.logService.trace('[URL #handleURL()] handled', uri.toString(true));
|
||||
this.logService.trace('URLService#handleURL(): handled', uri.toString(true));
|
||||
|
||||
await this.nativeHostService.focusWindow({ force: true /* Application may not be active */ });
|
||||
} else {
|
||||
this.logService.trace('[URL #handleURL()] not handled', uri.toString(true));
|
||||
this.logService.trace('URLService#handleURL(): not handled', uri.toString(true));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user