Redirect to vscode.dev/redirect and then vscode://.... (#254841)

So that the browser remembers who triggered the redirect.

Fixes https://github.com/microsoft/vscode/issues/254810
This commit is contained in:
Tyler James Leonhardt
2025-07-09 12:33:37 +02:00
committed by GitHub
parent 0f51f4269f
commit 8bd52a173e

View File

@@ -47,15 +47,17 @@
document.querySelector('.error-message > .detail').textContent = error;
document.querySelector('body').classList.add('error');
} else if (redirectUri) {
// Wrap the redirect URI so that the browser remembers who triggered the redirect
const wrappedRedirectUri = `https://vscode.dev/redirect?url=${encodeURIComponent(redirectUri)}`;
// Set up the fallback link
const fallbackLink = document.getElementById('fallback-link');
if (fallbackLink) {
fallbackLink.href = redirectUri;
fallbackLink.href = wrappedRedirectUri;
}
// Redirect after a delay
setTimeout(() => {
window.location = redirectUri;
window.location = wrappedRedirectUri;
}, 1000);
}
</script>