Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vscode:// links (or provide an alternate) #933

Closed
2 tasks done
goyalyashpal opened this issue Nov 30, 2021 · 12 comments
Closed
2 tasks done

Support vscode:// links (or provide an alternate) #933

goyalyashpal opened this issue Nov 30, 2021 · 12 comments
Labels
bug Something isn't working

Comments

@goyalyashpal
Copy link

goyalyashpal commented Nov 30, 2021

Checklist

  • This bug doesn't happen if I use Microsoft's Visual Studio Code. It only happens in VSCodium.
    i cant confirm that as i dont use VSCode, BUT it shouldnt happen with VSC as far as i can guess
  • I checked the Docs page and my issue is not mentioned there.

Summary

Lack of functionality due to vscode:// links being not supported

To Reproduce

Steps:

  1. Go to any repo on gitlab, example:
    https://gitlab.com/Moini/git_und_gitlab
  2. Click Clone
  3. Under "Open in your IDE" section, click any of those links
  4. If VSCodium is not installed, nothing happens

Expected:

  • VSCodium supports and open those links correctly

Desktop

  • OS: Win 10 20H2
  • Architecture: x64
  • Codium: 1.61.2

moved over the details to a separate comment

@goyalyashpal goyalyashpal added the bug Something isn't working label Nov 30, 2021
@daiyam
Copy link
Member

daiyam commented Nov 30, 2021

I don't think that the vscode protocol will ever be supported.
vscodium://vscode.git/clone?url=https%3A%2F%2Fgit.luolix.top%2FVSCodium%2Fvscodium.git is working fine...

You might need an extension or Tampermonkey' script to replace vscode:// with vscodium://

@goyalyashpal
Copy link
Author

i had already tried replacing only vscode:// with vscodium:// but that didnt work either. so....

@daiyam
Copy link
Member

daiyam commented Nov 30, 2021

It's because you replaced all vscode while the second vscode (vscode.git) is the id (which doesn't change between vscode and vscodium) of the extension which is doing the work.

I've just tried it on Windows 10 and it's working.

Edit: Another oopsy...

@daiyam
Copy link
Member

daiyam commented Nov 30, 2021

Just copy/paste the url vscodium://vscode.git/clone?url=https%3A%2F%2Fgit.luolix.top%2FVSCodium%2Fvscodium.git into the url bar of your browser.

While changing the url with the dev tools should work, the change might not be picked up if the page is built as an app with react or similar.

@goyalyashpal
Copy link
Author

goyalyashpal commented Nov 30, 2021

Just copy/paste the url vscodium://vscode.git/clone?url=https%3A%2F%2Fgit.luolix.top%2FVSCodium%2Fvscodium.git into the url bar of your browser.

ahhw right, it worked 👍 . niiiiiice.

but this also revealed 2 more things to me:

  • my faith on dev tools as being ultimate power was bit foolish like :childish-cry-emoji: x3
  • browser's address bar supports other protocol's link too
    had never tried anyth other than http(s) , file , ftp before

@daiyam
Copy link
Member

daiyam commented Nov 30, 2021

If the url isn't supported directly by the browser, it will confirm it with the user and send the request to the system.

@daiyam
Copy link
Member

daiyam commented Nov 30, 2021

The main reason to not support vscode is to avoid any conflict when both VSCode and VSCodium are installed (my case due to the remote extensions).

@goyalyashpal
Copy link
Author

goyalyashpal commented Nov 30, 2021

to avoid any conflict when both VSCode and VSCodium are installed

  • umh, i thought about the conflict, but on second thought, that's not an issue since it should pass through "open pick an app" dialog?
  • similar to how the conflict doesnt occur regarding tg://resolve?domain=telegram when both telegram desktop, and unigram are installed.
    (sorry, i dont have any suitable example for desktop other than these telegram apps 😅. however there are countless examples for multiple apps supporting same protocols/intents in android.)
  • or am i wrong regarding this "open pick an app" behaviour? how do non-windows systems handle this?

my case due to the remote extensions

i didnt understand that. i am guessing this is related with wsl remote extension?? i dont have experience with that either 😅

@goyalyashpal
Copy link
Author

goyalyashpal commented Nov 30, 2021

or am i wrong regarding this "open pick an app" behaviour

oh yeah, i forget that it becomes complicated once "Always use this app" is clicked. if i recall correct, then it's very hard to erase association in windows 10 to make it to ask/launch "open pick an app" again

i guess this concludes it then from my side. feel free to reopen if someone else has any idea for how can the pros of this suggestion outweigh cons.

But i still wonder how linux or mac handles these protocols/intent calls

@goyalyashpal
Copy link
Author

Tampermonkey' script to replace vscode:// with vscodium://

can u share the script?

@goyalyashpal
Copy link
Author

goyalyashpal commented Dec 14, 2021

I am separating out this section from description to separate comment here, just to keep things small sized. this is same old content, nothing new.


Details

  • Many sites provide links to make vscode do things like
    • opening extension page 1
    • open in IDE for cloning 2
  • Those links are not opened with vscodium
  • This results in a broken experience

Technical Details

Digging In

  1. The link for opening extension page is hidden, so, couldnt find it
  2. The link used for "open in IDE" for cloning is in this format:
    vscode://vscode.git/clone?url=<encoded-link>
  3. <encoded-link> ended in .git
  4. <encoded-link> were in URL encoding format, so,
    • %3A for :
    • %2F for /
  5. I tried replacing vscode://vscode.git/... with following in the Browser's Developer/Web-Inspector Tools, but it didnt work
    • vscodium://vscodium.git/...
    • vscodium://vscode.git/...
  6. So, in my opinion, supporting vscode:// links right away is a better option rather than doing vscodium://.
    This would be similar as Unigram app supports Telegram app's links in desktop, and both apps are shown in "Open with" dialog.3

Links Example

So, for vscodium's repo,

  • the raw link (HTTPS) is
    https://github.com/VSCodium/vscodium.git
  • encoded link will become:
    https%3A%2F%2Fgit.luolix.top%2FVSCodium%2Fvscodium.git
  • using it with vscode:// protocol and in the given format (point 1), it will become:
    vscode://vscode.git/clone?url=https%3A%2F%2Fgit.luolix.top%2FVSCodium%2Fvscodium.git

Footnotes

  1. in MS-VS-Market. See #911 and follow the links there

  2. in Gtilab. Screenshot:

  3. See this video🡭 -- from eclipse/openvsx#363

@tennox
Copy link

tennox commented May 23, 2022

One way to do it on linux is to add x-scheme-handler/vscode to the codium-url-handler.desktop file:

[Desktop Entry]
Name=VSCodium - URL Handler
Exec=/usr/bin/codium --open-url %U
...
MimeType=x-scheme-handler/vscodium;x-scheme-handler/vscode;

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants