diff --git a/site/src/modules/resources/AppLink/AppLink.tsx b/site/src/modules/resources/AppLink/AppLink.tsx index 1d82a46087f21..15ccfb3d0ed71 100644 --- a/site/src/modules/resources/AppLink/AppLink.tsx +++ b/site/src/modules/resources/AppLink/AppLink.tsx @@ -129,12 +129,13 @@ export const AppLink: FC = ({ app, workspace, agent }) => { } event.preventDefault(); + // This is an external URI like "vscode://", so // it needs to be opened with the browser protocol handler. - if (app.external && !app.url.startsWith("http")) { - // If the protocol is external the browser does not - // redirect the user from the page. + const shouldOpenAppExternally = + app.external && !app.url.startsWith("http"); + if (shouldOpenAppExternally) { // This is a magic undocumented string that is replaced // with a brand-new session token from the backend. // This only exists for external URLs, and should only @@ -149,12 +150,22 @@ export const AppLink: FC = ({ app, workspace, agent }) => { setFetchingSessionToken(false); } window.location.href = url; - } else { - window.open( - href, - Language.appTitle(appDisplayName, generateRandomString(12)), - "width=900,height=600", - ); + return; + } + + switch (app.open_in) { + case "slim-window": { + window.open( + href, + Language.appTitle(appDisplayName, generateRandomString(12)), + "width=900,height=600", + ); + return; + } + default: { + window.open(href); + return; + } } }} >