code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: desktop-only extensions are forced to disable in code-server

Open Creling opened this issue 3 years ago • 6 comments

Hi,

When I try to enable Remote - SSH, the code-server says This extension is disabled because it is defined to run only in code-server for the Desktop.

I understand that may guys have discuessed it before in #1315. But it is strange that Open Remote - SSH, an open-source alternative for Remote - SSH, is also forced to disable in code-server.

This limitation is known to exists in vscode.dev as their doc describes:

Since VS Code for the Web runs completely within the browser, some experiences will naturally be more constrained when compared to what you can do in the desktop app. For example, the terminal and debugger are not available, which makes sense since you can't compile, run, and debug a Rust or Go application within the browser sandbox.

But I think code-server is somewhat different from vscode.dev since it is not running completely within the browser ?

Creling avatar Oct 01 '22 03:10 Creling

Sadly, I don't think there is much we can do to support Remote - SSH 😢

But it is strange that Open Remote - SSH, an open-source alternative for Remote - SSH, is also forced to disable in code-server.

Have you tried raising an issue with the extension author?

jsjoeio avatar Oct 04 '22 16:10 jsjoeio

Have you tried raising an issue with the extension author?

jeano413 (the author) mentioned a SPECIAL API in an code-server-related issue raised before:

This extension uses a special vscode API to connect the local ui to the remote machine. https://github.com/jeanp413/open-remote-ssh/issues/3

I post a new reply in the issue for more information just now.

Creling avatar Oct 05 '22 02:10 Creling

Awesome! I'll comment on there.

jsjoeio avatar Oct 05 '22 17:10 jsjoeio

Hi, old conversation I know but what you can try (not good practice but if you need an extension):

  1. Open the .vsix
  2. Go in the "extension" folder
  3. Edit the "package.json" file
  4. Search for "extensionKind" and if it only says:
 "extensionKind": [
    "ui"
  ],

then just remove the whole part.

I'm using the newest version and I couldn't install a specific wasm-extension but after removing this part, it was installed flawlessly and I was able to use it.

liebki avatar Nov 13 '23 13:11 liebki

Hi, old conversation I know but what you can try (not good practice but if you need an extension):

  1. Open the .vsix
  2. Go in the "extension" folder
  3. Edit the "package.json" file
  4. Search for "extensionKind" and if it only says:
 "extensionKind": [
    "ui"
  ],

then just remove the whole part.

I'm using the newest version and I couldn't install a specific wasm-extension but after removing this part, it was installed flawlessly and I was able to use it.

Nice hacks, I want to use antfu.browse-lite in github codespace, and I can debug and run this extension in codespace, so this extension should work in codespace. But when I installed the extension, it just shown This extension is disabled because it is defined to run only in code-server for the Desktop. and could not use in codespace.

Remove extensionKind in package.json of vsix file (zip file acturally), then installed from vsix works for me.

For this extension, you have to install and configure chrome.

  1. install chrome
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt update
sudo apt install -y ./google-chrome-stable_current_amd64.deb
  1. config extension settings
browse-lite.chromeExecutable: /usr/bin/google-chrome

Then this extension works like a charm.

liudonghua123 avatar Dec 22 '23 06:12 liudonghua123

From the docs on https://code.visualstudio.com/api/advanced-topics/remote-extensions#common-problems, I found a more elegant and clean method. Just add the following configurations to json settings. The remote.extensionKind will overwrite the extensionKind in package.json of extension.

Using this method, the extension could auto update without modification.

    "remote.extensionKind": {
        "antfu.browse-lite": [
            "ui",
            "workspace",
        ]
    }

liudonghua123 avatar Dec 22 '23 07:12 liudonghua123

Closing since there is nothing we can do on our end. The workspace addition is the right fix!

code-asher avatar Mar 12 '24 19:03 code-asher