Skip to content

Add "Integrated browser" support for code-server #7962

Description

@chr-wei

What is your suggestion?

I would love to see the "integrated browser" from vscode inside code-server (not to be confused with the "simple browser" that is already integrated).

Why do you want this feature?

The simple browser has limitations regarding localhost servers. E.g. reaching a local vite.dev webserver is not possible.

Are there any workarounds to get this functionality today?

You could open a port and expose it via the ports suburl. But that prevents to use automation features that the new "integrated browser" has.

Are you interested in submitting a PR for this?

Yes. I would like the team to estimate whether an integration is technically possible and to know which main knobs need to be turned.

See my issue in the official vscode repo for current technical limitations (vscode.dev)
microsoft/vscode#331784 (comment)

Activity

  1. linear-code commented on Aug 25, 2026

    @linear-code
  2. code-asher commented on Aug 26, 2026

    @code-asher
    Member

    Could probably implement it with an iframe, but I am not sure we would want to maintain a patch for that feature here, unless it is a small patch (I am not sure how much work it would be). Would definitely be better to get such a feature merged upstream in VS Code core.

  3. code-asher commented on Aug 26, 2026

    @code-asher
    Member

    Although if the simple browser extension is not working for only localhost addresses, that could just be a bug in code-server or the extension and it might be easier to fix that. For example maybe we are not properly rewriting localhost URIs to go through the proxy, or maybe the plugin is not using asExternalUri.

    + resolveExternalUri: (uri: URI): Promise<URI> => {
    + let resolvedUri = uri
    + const localhostMatch = extractLocalHostUriMetaDataForPortMapping(resolvedUri)
    + if (localhostMatch && resolvedUri.authority !== location.host) {
    + if (config.productConfiguration && config.productConfiguration.proxyEndpointTemplate) {
    + const renderedTemplate = config.productConfiguration.proxyEndpointTemplate
    + .replace('{{port}}', localhostMatch.port.toString())
    + .replace('{{host}}', window.location.host)
    + resolvedUri = URI.parse(new URL(renderedTemplate, window.location.href).toString())
    + } else {
    + throw new Error(`Failed to resolve external URI: ${uri.toString()}. Could not determine base url because productConfiguration missing.`)
    + }
    + }
    + // If not localhost, return unmodified.
    + return Promise.resolve(resolvedUri)
    + },

    But when I tried, the extension does not work at all for either local or external hosts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSome improvement that isn't a feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions