未验证 提交 d295d140 编写于 作者: I isidor

fixes #122353

上级 ed5d4a13
......@@ -12,6 +12,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { Schemas } from 'vs/base/common/network';
import { isIOS, isMacintosh } from 'vs/base/common/platform';
import Severity from 'vs/base/common/severity';
import { URI } from 'vs/base/common/uri';
import { localize } from 'vs/nls';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { registerWindowDriver } from 'vs/platform/driver/browser/driver';
......@@ -140,10 +141,14 @@ export class BrowserWindow extends Disposable {
if (matchesScheme(href, Schemas.http) || matchesScheme(href, Schemas.https)) {
const opened = windowOpenNoOpener(href);
if (!opened) {
const showResult = await this.dialogService.show(Severity.Warning, localize('unableToOpenExternal', "The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."), [localize('open', "Open"), localize('cancel', "Cancel")], { cancelId: 1, detail: href });
const showResult = await this.dialogService.show(Severity.Warning, localize('unableToOpenExternal', "The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),
[localize('open', "Open"), localize('learnMore', "Learn More"), localize('cancel', "Cancel")], { cancelId: 2, detail: href });
if (showResult.choice === 0) {
windowOpenNoOpener(href);
}
if (showResult.choice === 1) {
await this.openerService.open(URI.parse('https://aka.ms/allow-vscode-popup'));
}
}
} else {
this.lifecycleService.withExpectedUnload(() => window.location.href = href);
......
......@@ -388,7 +388,7 @@ export class BrowserHostService extends Disposable implements IHostService {
const opened = await this.workspaceProvider.open(workspace, options);
if (!opened) {
const showResult = await this.dialogService.show(Severity.Warning, localize('unableToOpenExternal', "Opening a new workspace tab or window has been prevented by the browser. You must give permission to continue."), [localize('continue', "Continue"), localize('cancel', "Cancel")], { cancelId: 1 });
const showResult = await this.dialogService.show(Severity.Warning, localize('unableToOpenExternal', "The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."), [localize('open', "Open"), localize('cancel', "Cancel")], { cancelId: 2 });
if (showResult.choice === 0) {
await this.workspaceProvider.open(workspace, options);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册