Skip to content

Update window open handler to accept new allowlisted protocols#152

Merged
sergeichestakov merged 1 commit intomainfrom
@sergeichestakov/fix-external-protocols-allow-list
Mar 15, 2024
Merged

Update window open handler to accept new allowlisted protocols#152
sergeichestakov merged 1 commit intomainfrom
@sergeichestakov/fix-external-protocols-allow-list

Conversation

@sergeichestakov
Copy link
Copy Markdown
Contributor

Why

Follow on to #151, I missed a spot here when I updated our allowlisted protocols to include replit:// and vscode://. We need to update the window open handler logic to match that of the will-navigate event handler to account for URLs opened via target="_blank" and programmatically via window.open. This ensures the behavior will be consistent to what we see in the will-navigate handler which fires in all other cases.

What changed

Update window open handler to accept new allowlisted protocols to match what we do in the will nav handler so that target=_blank and window.open work as expected.

Test plan

  • Open desktop app in dev
  • Open browser console
  • Enter window.open("replit://new")
  • Previously (on main) this be a no-op and not do anything
  • Now, this will open a new Replit window to the new repl flow as expected

@sergeichestakov sergeichestakov self-assigned this Mar 15, 2024
@sergeichestakov sergeichestakov requested review from a team, masad-frost and szymonkaliski and removed request for a team March 15, 2024 13:13
Copy link
Copy Markdown
Contributor

@szymonkaliski szymonkaliski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@sergeichestakov sergeichestakov merged commit e5998ce into main Mar 15, 2024
@sergeichestakov sergeichestakov deleted the @sergeichestakov/fix-external-protocols-allow-list branch March 15, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants