0

I am making a UWP app which opens all the http/https protocol links clicked in the Windows. In short it's acts same as a Default Browser.

I used the following to associate with http/https protocols

      <Extensions>
        <uap:Extension Category="windows.protocol">
            <uap:Protocol Name="http">
                <uap:DisplayName>httpUWP</uap:DisplayName>
            </uap:Protocol>
        </uap:Extension>
        <uap:Extension Category="windows.protocol">
            <uap:Protocol Name="https">
                <uap:DisplayName>HttpUWP</uap:DisplayName>
            </uap:Protocol>
        </uap:Extension>
      </Extensions>

and a method to handle the launch protected override void OnActivated(IActivatedEventArgs args)

The App compiles good. I set my app as default opener for http and When I try to open a link from Win + R or somewhere from system, The app gives out a File system error (-2147219196)

So, What am I supposed to do now?

Chanakya3721
  • 1
  • 1
  • 3

1 Answers1

0

I am afraid http and https are among the URI scheme names that are reserved for the operating system so you cannot associate these with your app.

You may still change the default browser in Windows though.

mm8
  • 163,881
  • 10
  • 57
  • 88
  • I already set my App as default and When I open a link, The App starts, shows the splash screen and the system gives that error. – Chanakya3721 Aug 12 '21 at 11:49
  • You still shouldn't associate your app with any reserved URI schemes. – mm8 Aug 12 '21 at 11:52
  • It makes sense to have some reserved stuff. But in reserved file type, even `.mp3` is listed. So, Does that mean no UWP app can be a Default Music Player ? – Chanakya3721 Aug 12 '21 at 11:57
  • It means that it shouldn't associate with that protocol. The default app for a specific type of file is an OS setting that cannot be "hijacked" by a custom app basically. – mm8 Aug 12 '21 at 12:18