Github Desktop mess with x-github-desktop protocol
See original GitHub issueDescription
Cloning process with ‘Open In Desktop’ from browser is not starting.
Version
- GitHub Desktop: 1.4.1
- Operating system: Windows 7 x64
Steps to Reproduce
Launch ‘Open In Desktop’ for any repo GitHub Desktop shows up Nothing happens
Expected Behavior
Cloning process
Actual Behavior
Nothing happens
Additional Information
I’m reopening the issue since #5324 was closed and there is definitely something wrong with URI for x-github-desktop protocol.
Since electron protocol CVE was discovered and fixed with:
https://github.com/desktop/desktop/blob/7e9f40403be55d89b18a430f5bd3407eeafc8b54/app/src/main-process/main.ts#L139-L151
GitHub desktop requires arguments to be passed as
"GitHubDesktop.exe" --protocol-launcher -- "x-github-client://openRepo/https://github.com/blablablalala"
To enforce that behaviour in Windows there is a documented way. Summary of it will be following:
For example, to associate alert: protocol to alert.exe, create following registry keys:
HKEY_CLASSES_ROOT
alert
(Default) = "URL:Alert Protocol"
URL Protocol = ""
DefaultIcon
(Default) = "alert.exe,1"
shell
open
command
(Default) = "C:\Program Files\Alert\alert.exe" "%1"
For security reasons with electron protocol the command string should be
(Default) = "C:\Program Files\Alert\alert.exe" --protocol-launcher -- "%1"
So I assume there should be the same registry key in my Windows x64 workstation with additional ‘–protocol-launcher’ and ‘–’ there, like:
HKEY_CLASSES_ROOT
x-github-client
(Default) = "URL:x-github-client"
URL Protocol = ""
DefaultIcon
(Default) = "GitHubDesktop.exe,1"
shell
open
command
(Default) = "C:\Users\User\AppData\Local\GitHubDesktop\GitHubDesktop.exe" --protocol-launcher -- "%1"
But there is not! Instead what I have is following:
- HKEY_CLASSES_ROOT\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_CLASSES_ROOT\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_CURRENT_USER\Software\Classes\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_CURRENT_USER\Software\Classes\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_LOCAL_MACHINE\SOFTWARE\Classes\x-github-client that is empty
- HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000\Software\Classes\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000\Software\Classes\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000_Classes\x-github-client\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
- HKEY_USERS\S-1-5-21-1186505040-3499372643-3030342882-1000_Classes\x-github-desktop-auth\shell\open\command(Default) = “C:\Users\User\AppData\Local\GitHubDesktop\app-1.4.1\GitHubDesktop.exe” --protocol-launcher “%1”
The reasons GitHub desktop is not working:
- Is not Firefox or any other browser handling of x-github-client protocol.
- There is definitely missed second argument ‘–’. It’s the main reason.
- There is hell more registry keys then it should be.
- That keys are refreshed at every launch of GitHub Desktop so I assume the GH Desktop is rewriting it with the wrong string.
- It seems wrong that there are multiple versions of GitHubDesktop.exe and especially that ‘app-1.4.1’ version is used instead of ‘GitHubDesktop.exe’ in root folder ‘…\AppData\Local\GitHubDesktop\…’
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top GitHub Comments
Okay, for future reference: This is some kind of problem in firefox and it’s protocol handling in general. Bug report to follow.
P.S.: From my experience this fix is not going to happen soon because related bug report reported at the end of 2017 is still there with low priority.
@iAmWillShepherd Thank you for detailed answer and for your time. If it is the case that now reinstall of GitHub Desktop will solve the problem for firefox in Windows 7 I will definitely do it. That’s unfortunate that such a simple solution took so complicated discussion. I will try it tomorrow.