Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup blocked opening the codespace #161959

Open
bpasero opened this issue Sep 27, 2022 · 4 comments
Open

Popup blocked opening the codespace #161959

bpasero opened this issue Sep 27, 2022 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug continue-working-on debt Code quality issues
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Sep 27, 2022

Testing #161875

Source: insiders.vscode.dev
Target: GH Codespace

The CS was not opened due to popup blocking:

image

@joyceerhl
Copy link
Collaborator

@bpasero The created codespace should have opened in a new tab, which browser is this, and did you configure a popup blocking preference before? Does this happen for all external links opened from vscode.dev?

@joyceerhl joyceerhl added the info-needed Issue requires more information from poster label Sep 27, 2022
@bpasero
Copy link
Member Author

bpasero commented Sep 27, 2022

No this happened because from my user interaction to opening the window, a lot of time passed. Next time I did this, the window opened. I believe browser vendors have different thresholds where they allow a window from opening when it is close to user action. I know Safari is worst here which even made us implement a fallback:

// HTTP(s): open in new window and deal with potential popup blockers
if (matchesScheme(href, Schemas.http) || matchesScheme(href, Schemas.https)) {
if (isSafari) {
const opened = windowOpenWithSuccess(href, !isAllowedOpener);
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('learnMore', "Learn More"),
localize('cancel', "Cancel")
],
{
cancelId: 2,
detail: href
}
);
if (showResult.choice === 0) {
isAllowedOpener
? windowOpenPopup(href)
: windowOpenNoOpener(href);
}
if (showResult.choice === 1) {
await this.openerService.open(URI.parse('https://aka.ms/allow-vscode-popup'));
}
}
} else {
isAllowedOpener
? windowOpenPopup(href)
: windowOpenNoOpener(href);
}
}

@joyceerhl joyceerhl added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Sep 27, 2022
@joyceerhl
Copy link
Collaborator

@bpasero should we then always have this fallback logic even when not on Safari?

@bpasero
Copy link
Member Author

bpasero commented Sep 29, 2022

Yeah why not, we have to validate that our logic works in other browsers 👍

@joyceerhl joyceerhl modified the milestones: October 2022, November 2022 Oct 24, 2022
@joyceerhl joyceerhl modified the milestones: January 2023, February 2023 Jan 23, 2023
@joyceerhl joyceerhl modified the milestones: February 2023, March 2023 Feb 22, 2023
@joyceerhl joyceerhl modified the milestones: March 2023, April 2023 Mar 20, 2023
@joyceerhl joyceerhl modified the milestones: April 2023, May 2023 Apr 24, 2023
@joyceerhl joyceerhl modified the milestones: May 2023, June 2023 May 27, 2023
@joyceerhl joyceerhl modified the milestones: June 2023, July 2023 Jun 26, 2023
@joyceerhl joyceerhl added the debt Code quality issues label Jun 26, 2023
@joyceerhl joyceerhl removed this from the July 2023 milestone Jul 27, 2023
@joyceerhl joyceerhl added this to the August 2023 milestone Jul 27, 2023
@joyceerhl joyceerhl modified the milestones: August 2023, September 2023 Aug 28, 2023
@joyceerhl joyceerhl modified the milestones: October 2023, November 2023 Oct 26, 2023
@joyceerhl joyceerhl modified the milestones: November 2023, December 2023 Nov 29, 2023
@joyceerhl joyceerhl modified the milestones: December / January 2024, February 2024 Jan 24, 2024
@joyceerhl joyceerhl modified the milestones: February 2024, Backlog Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug continue-working-on debt Code quality issues
Projects
None yet
Development

No branches or pull requests

2 participants