1

How does GitHub launch its GitHub Desktop application directly from the browser?

It works even when using Google Chrome. I thought that this was impossible outside of Internet Explorer.

2
  • 1
    Does it launch as soon as you visit a site or after you click a link? If you need to click a link check the format of the link. They might have simply registered their own protocol handler. An example for this would be steam as well. – Seth Dec 16 '16 at 8:35
  • @Seth Google chrome doesn't support custom protocols, I think that is only Internet Explorer that allows you to add a registry key. – cascading-style Dec 16 '16 at 15:53
1

Lets assume you register a custom protocl following the guide Registering an Application to a URI Scheme

Using a simple reg file that looks like the following you would register a custom protocol named mytest: that starts C:\temp\test.bat when its called.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\mytest]
@="URL:mytest Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\mytest\shell]

[HKEY_CLASSES_ROOT\mytest\shell\open]

[HKEY_CLASSES_ROOT\mytest\shell\open\command]
@="\"C:\\temp\\test.bat\" \"%1\""

Using the following content for test.bat you would get a cmd window that displays the argument and stays open:

echo %1%
pause

This works straight on your cmd, IE and Firefox. Chrome and Opera would give you a warning that you're about to start an application. This information is also available in this question: Custom protocol handler in chrome

If you look further into it you will find that the github application registers a github-windows protocol using that way. So it's likely that there IS a way available to make it work with chrome. Sadly, right now, I can't dig further into it as the Application doesn't want to react on any browser.

5
  • When launching using chrome, it asks Do you want to launch test.bat?... Is there any way to change where it says test.bat into My Program so that it reads: Do you want to launch My Program?? – cascading-style Dec 16 '16 at 19:27
  • It would always be what you make the executable. You would need to change the bath to the batch file to the one you want to use. It's the last line of the reg. The $1 would be the argument which would be the whole "url" you called. – Seth Dec 16 '16 at 21:51
  • Ok, the reason I asked was that in Microsoft Edge, when you open an xbox link, it asks: DID YOU MEAN TO SWITCH APPS? "Microsoft Edge" is trying to launch "Xbox Gaming" and I was wondering how it set the name. – cascading-style Dec 16 '16 at 22:07
  • any idea how that works? – cascading-style Dec 17 '16 at 20:15
  • Not really. I don't have the XBOX app installed (only Windows 7) but you could just have a look at HKCR and look for an xbox protocol. Searching from the top of HKCR should work. You could use F3 to jump to the next hit. Also check the Edge Addons/Plugins to see whenever they just register a Addon/Plugin. I haven't done any further digging as the integration simply doesn't work on my system in any kind of browser. – Seth Dec 19 '16 at 6:38
0

[Program Setup] Add the subkey to your application "SupportedProtocols" HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

Next add a Str Type with the name of each Protocol you want your program to handle, with no values

[Application Setup] Next add/update your application's entry under HKEY_CLASSES_ROOT\Applications\

*If your application needs to save the URL, do the following: Add a Str Type named "SaveURL"

*If your application needs to use the URL, do the following: Add a DWORD Type named "UseURL" Set it's value to 1

The above should enable support for your application

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.