0

Not a duplicate of: "How to open URL in Microsoft Edge from the command line?": This question is not a duplicate of the question linked above. The question linked above is about having Edge display a specified URL when launched from the command line. This question is about how a program external to the browser is launched by clicking on a link from within a web browsers such as Chrome and Firefox. I would appreciate it if someone would reopen this.

I was wondering how Microsoft is able to open up their applications such as Store and Edge from my browser.

For example when I'm using Google Chrome,

  • On their site at the top there is a message saying (it only seems to appear if you use Windows) "Try Microsoft Edge".

    enter image description here

  • If you press Get started there is a confirmation screen that launches Edge. This is from Chrome but it seems to work in Firefox as well.

    enter image description here

This can also be seen on the Microsoft Web Store, which opens the Store on Windows 10 (once again this only works if you're on Windows)

enter image description here

As far as I know application cannot be launched from a webpage so how do they do it?

Xantium
  • 11,201
  • 10
  • 62
  • 89
  • This is different from the question it have been duplicated to because that uses command line to launch Edge. This question I want to launch it from web browsers such as Chrome and Firefox. Could somebody please reopen it? – Xantium Oct 16 '17 at 22:24
  • 1
    It probably has to do with Microsoft Edge having special access to the operating system compared to Chrome or Firefox. This is not typically possible in those browsers. – TylerH Nov 20 '17 at 21:33
  • See https://stackoverflow.com/questions/185423/how-can-i-open-a-link-in-the-default-web-browser-from-an-hta – TylerH Nov 20 '17 at 21:33
  • @TylerH No help unfortunately. – Xantium Nov 20 '17 at 21:53
  • @Stephen Kennedy May I ask why you removed the html tag as well? This is a necessary tag since the aim of my question is to find out how they do it. This would most likely involve html code. – Xantium Jan 01 '18 at 17:10
  • I guess it will be a special uri and not html but I don't actually know. All shall hopefully become clear when the question is reopened (it has 4 reopen votes of the 5 needed). – Stephen Kennedy Jan 01 '18 at 17:16
  • Yes, it is a special URI: microsoft-edge:https://www.microsoft.com/en-gb/?epb=1&form=MY009W There are similar 'special' URIs to open Skype, a Bitcoin wallet and so on. – Stephen Kennedy Jan 01 '18 at 17:17
  • @StephenKennedy Thank you I've been puzzled how they did this for ages. I'll remove the html tag then. – Xantium Jan 01 '18 at 17:20
  • 1
    the URI I pasted in came from the source code of one of the web pages you referenced. I've just had a dig around in Windows settings and confirmed: there is a protocol handler set up to handle `microsoft-edge:` links in Control Panel\Default Programs. – Stephen Kennedy Jan 01 '18 at 17:25
  • @StephenKennedy Oh I see `ms-windows-store://pdp/?productid=9WZDNCRFJ27N&referrer=unistoreweb&scenario=click&webig=5026df24-9f50-4c83-a634-1fc95c37bbb1&muid=21A227FFB6846EC5165B2D32B2846DA1&websession=fc08e3d703294376894c45497537cce9` came from the page that opened Store. Notice the `ms-windows-store:` at the front. – Xantium Jan 01 '18 at 17:35
  • Yep, same concept. I believe you can do the same if you register a protocol handler so that Windows knows which program to open when your 'special' URI is clicked. I seem to recall doing that via the registry years ago. Anyway that's all from me - I might come back and leave an answer if the question is reopened though. Or it might now be a duplicate now we know that it is URI/protocol handler scheme. Cheers. – Stephen Kennedy Jan 01 '18 at 17:44
  • @StephenKennedy Thanks for everything. I really appreciate the info. If it does get reopened please do that. It's useful for future visitors as I'm sure others are also who are curious as to how this is done. I'll ping you if it does get reopened. Thanks again! – Xantium Jan 01 '18 at 18:24
  • While I agree that the question which is the current dup-target is incorrect, it's not clear to me that the question would not be closed as "too broad" if it was reopened. You are currently asking multiple questions. "How does Microsoft do this", "How can I do this from my web page?" (You can't, without having already changed the user's OS configuration from outside the browser), "How is this different from the way Android does something similar". At a minimum, you need to [edit] this Question so it's only asking one (reasonably narrow) question. – Makyen Jan 08 '18 at 06:24
  • Once you do narrow this question, it is likely to be a duplicate of a different question, as there are multiple [questions on Stack Overflow about registering your own protocol/scheme handler](https://stackoverflow.com/search?q=register+custom+windows+protocol+handler). – Makyen Jan 08 '18 at 06:31
  • FYI: The first URL you provide does not show me a "Try Microsoft Edge" banner in Chrome or Firefox on Win10. I would suggest swapping the order of your examples, as people may be inclined to consider this to be not reproducible based on the first example. – Makyen Jan 08 '18 at 06:39
  • @Makyen I've edited and it looks to me like I'm asking one question now, I would appreciate it if you gave me your opinion and to your third comment seems very strange. It certainly shows in my browsers. – Xantium Jan 08 '18 at 09:33
  • @Makyen Also I've looked through the link you gave and I can't see a duplicate. – Xantium Jan 08 '18 at 09:45
  • @Simon, My third comment is just reporting my experience based on my testing. You have settled on asking about how Microsoft does this instead of asking about how you can do it yourself. I have some topicality concerns with that (it's mostly a system configuration issue). As to not finding a duplicate, I'm not surprised. The search I provided was focused on your question of how to do it yourself, rather than specifically what links Microsoft uses. I'd have to search more specifically for something that explains what's happening. – Makyen Jan 08 '18 at 13:15

0 Answers0