How can I install a Microsoft Edge extension without user interaction?

一曲冷凌霜 提交于 2019-12-05 01:25:00

问题


I'm currently working on a Microsoft Edge extension which will be deployed in an enterprise environment.

The Edge extension has been currently installed manually (and reloaded at each browser restart since it's from an unknown source).

For Internet Explorer extensions, the DLL can be registered on the system with RegAsm and a Registry tweak allows loading all add-ons (the IgnoreFrameApprovalCheck key, see this link) without any user prompt.

Is there a similar way of adding Edge extensions automatically to the browser with no user interaction?

Thank you!


回答1:


At least until now (7/29/2016), installation of extensions for Microsoft Edge must be initiated and completed by the user. However, this policy may change in the future release, I'm not sure.

All extensions for Microsoft Edge must be deployed from the Windows Store. The installation must be initiated and completed by the user, using only the user experience provided by Microsoft Edge and the Windows Store. Software may refer to the extension in the Windows Store, but may not change the experience of acquiring the extension, or otherwise apply undue influence or false pretenses to the user to make them install the extension.




回答2:


I think it's worth trying Add-AppxPackage. You will need:

  • Packed extension, signed with a certificate that all target machines will trust. Should be possible in enterprise environment.
  • .ps1 installation script file, signed as well.
  • Set-ExecutionPolicy changed to AllSigned option on all target machines.

Package should be signed because otherwise Add-AppxPackage would not work. Set-ExecutionPolicy is usually set to Restricted, and that will prevent ps1 files from running (and Add-AppxPackage is a PowerShell-only tool) — that's why you'll need to force AllSigned mode and sign your script. There's also Unrestricted mode, but it's totally not recommended.

Then you write a .ps1 script with something like

Add-AppxPackage Path\to\Your_extension.appx

And deploy on target machines with your method of choice. Here you can find some methods of invoking it silently.

Please note that users will probably need to enable newly installed extension manually.



来源:https://stackoverflow.com/questions/38640148/how-can-i-install-a-microsoft-edge-extension-without-user-interaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!