0

I implemented the example from Create and consume an app service and extended it by a WebExtension (it uses the AppServiceProvider for native messaging), which resides in a folder Extension within the AppServiceProvider project. But the created .appx file does not install the WebExtension to Edge. The other components are installed and working. I configured the property Copy to Output Directory to Copy always for all files inside the Extension folder. There does not appear any error message during the installation.

Why is the WebExtension not installed by the .appx?

Are there any values that must exist in Package.appxmanifest or manifest.json?

Any help will be appreciated, thanks!

Ronquam
  • 145
  • 2
  • 13
  • It can be possible that you did not disclose the caller's Package Family Name in AppxManifest file like this. 'appService.CallerPackageFamilyName == EdgePFN ' You can have a check and try to refer the steps mentioned in link below may help to install the add on in Edge. Ref: https://learn.microsoft.com/en-us/microsoft-edge/extensions/guides/native-messaging#app-services If your issue persist than please try to provide a sample project file. We will try to check if there is something missing in it. – Deepak-MSFT Mar 12 '19 at 09:37
  • @Deepak-MSFT Indeed, the line `appService.CallerPackageFamilyName == EdgePFN` is missing. But no example from [MicrosoftEdge-Extensions-Demos](https://github.com/MicrosoftEdge/MicrosoftEdge-Extensions-Demos) contains such a line. E.g., in SecureInput/NativeMessagingHostOutOfProcessAppService/Task.cs line 46 Edge is assumed to be the caller when the else branch is entered, but Edge's Package Family Name is never explicitly checked. Wouldn't this allow every app to connect? Furthermore, how can the value determined with which the placeholder `EdgePFN` has to be replaced? – Ronquam Mar 13 '19 at 09:46
  • Yes I can see that, As per the Native messaging documentation. You'll also need to set which extension(s) are allowed to connect to the service. Because Microsoft Edge doesn't have an equivalent "allowed_origins" manifest property in its AppxManifest, this will need to be determined and enforced at runtime by your UWP app. Since Microsoft Edge will be establishing the connection on behalf of the extension, the app can look up the caller's Package Family Name to determine if they're being connected by Microsoft Edge to control or authenticate the caller. So you can have a test with it. – Deepak-MSFT Mar 14 '19 at 06:57
  • I added the check `if ( appService.CallerPackageFamilyName == "Microsoft.MicrosoftEdge_8wekyb3d8bbwe" )`, but the extension is still not installed. – Ronquam Mar 14 '19 at 16:09
  • If possible for you, than can you please try to share the sample of your project? We can try to check it and make a test with it on our end to find the cause for the issue. Thanks for your understanding. – Deepak-MSFT Mar 15 '19 at 08:04
  • Under https://send.firefox.com/download/17b433e71e/#K1jh14RJE_JAYlFYa2azYQ you can find the project. I removed the private keys, so you have to generate new ones. – Ronquam Mar 26 '19 at 14:40

0 Answers0