未验证 提交 66961037 编写于 作者: J João Moreno 提交者: GitHub

Fixes #111814 (#119475)

* fixes #111814

* disposable
上级 57aada6c
......@@ -9,6 +9,8 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { AbstractURLService } from 'vs/platform/url/common/urlService';
import { Event } from 'vs/base/common/event';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IOpenerService, matchesScheme } from 'vs/platform/opener/common/opener';
import { IProductService } from 'vs/platform/product/common/productService';
export interface IURLCallbackProvider {
......@@ -43,13 +45,29 @@ export class BrowserURLService extends AbstractURLService {
private provider: IURLCallbackProvider | undefined;
constructor(
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
@IOpenerService openerService: IOpenerService,
@IProductService productService: IProductService
) {
super();
this.provider = environmentService.options?.urlCallbackProvider;
this.registerListeners();
const that = this;
this._register(openerService.registerOpener({
async open(resource: URI | string) {
if (!matchesScheme(resource, productService.urlProtocol)) {
return false;
}
if (typeof resource === 'string') {
resource = URI.parse(resource);
}
return that.open(resource);
}
}));
}
private registerListeners(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册