0

I'm developing an app for Windows 8.1 called myTrip and I'm implementing my custom scheme URI for the app. I want this URI : mytrip:place:/m/0942y1 to open my app and navigate to a place with that ID. I have the logic done, it works fine if I run it from Windows + r. I want to distribute this uris in a facebook page, and when a user clicks on it, the app will open and the place shown. It's more or less the same thing that the windows store web page of your app does:

http://apps.microsoft.com/windows/en-us/app/mytrip/ae689d16-f349-4596-8bc7-e0eeab87ec24

This works in IE and Chrome, the schema that opens the store app is this:

ms-windows-store:PDP?PFN=19185FernandoUrkijoCerced.MyTrip_q1p7rzex4ekjr

If you copy and paste it on Chrome, and you have Windows 8, the app store will open. But, if I try with my custom URI:

myTrip:place:/m/0942y1

It only works on IE, not on Chrome. Why the Windows app store schema URI works with Chrome and not with my schema? Any ideas or hacks to bypass this problem?

Thanks you.

Fritjof Berggren
  • 3,178
  • 5
  • 35
  • 57

1 Answers1

1

Chrome does not automatically recognize custom protocol handlers. Firefox will recognize when you are trying to use a protocol handler and offer to create a protocol handler definition for you. IE recognizes them.

On top of this, Chrome by default excludes protocol handlers it doesn't know.

In order to add your app's handler to Chrome:

With Chrome Closed

  • Navigate to "C:\Users\%Username%\AppData\Local\Google\Chrome\User Data"
  • Edit the file "Local State" with Notepad (or Notepad++)
  • Go down to the section marked "protocol_handler". You can also search for "ms-windows-store"
  • Add a line in "excluded schemes": "myTrip": false,
  • Save the file
  • Start Chrome

You should be able to use your protocol inside Chrome now.

Nate Diamond
  • 5,525
  • 2
  • 31
  • 57
  • Thanks for the answer, but it is not only for me. I'm trying to make peole click in a schema uri posted in a facebook page, in different browsers, so I cannot ask them to do this. – Fritjof Berggren Feb 26 '14 at 20:05
  • 1
    What you may be able to do is link to a page which registers a custom protocol handler using `navigator.registerHandler`. You can find out more [here](http://stackoverflow.com/questions/7087728/custom-protocol-handler-in-chrome). – Nate Diamond Feb 26 '14 at 20:08