Follow on to https://github.com/replit/desktop/pull/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
Why
Follow on to https://github.com/replit/desktop/pull/151, I missed a spot here when I updated our allowlisted protocols to include
replit://
andvscode://
. We need to update the window open handler logic to match that of thewill-navigate
event handler to account for URLs opened viatarget="_blank"
and programmatically viawindow.open
. This ensures the behavior will be consistent to what we see in thewill-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
andwindow.open
work as expected.Test plan
window.open("replit://new")