Microsoft Edge 中 Flash 的注册表项

Registry key for Flash in Microsoft Edge

我需要 Enable/Disable Flash for Edge 在 C# 中实用。我用谷歌搜索了下面的注册表项,但其中 none 个可以在 Edge 上启用 Flash。谁能告诉我在 Windows 2016.

上启用 Flash on Edge 时使用了什么注册表项
HKEY_CURRENT_USER \ SOFTWARE \ Classes \ Local Settings \ Software\Microsoft\Windows\CurrentVersion\AppContainer \ Storage \ microsoft.microsoftedge_8wekyb3d8bbwe \ MicrosoftEdge \ Addons\

并设置 FlashPlayerEnabled = 1。

另一个是:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Addons

并设置 FlashPlayerEnabled = 1。

首先,你问题中的第二种做法是正确的。我已经在 Windows 10 上的 Microsoft Edge 44.18362.1.0 上对其进行了测试,它可以正常工作。 official docs 中也列出了该方法。但我们还需要注意,支持的版本是 Microsoft Edge on Windows 10.

其次,Windows Server 2016 不支持 Microsoft Edge。即使您已在 Windows Server 2016 上成功安装 Microsoft Edge,也可能有许多功能不受支持。这可能是原因为什么注册表在 Windows 2016 年无法正常工作,而且我看不到有解决方案。从this doc可以看出:

The Long-Term Servicing Branch (LTSB) versions of Windows, including Windows Server 2016, don’t include Microsoft Edge or many other Universal Windows Platform (UWP) apps. Systems running the LTSB operating systems do not support these apps because their services get frequently updated with new functionality. For customers who require the LTSB for specialized devices, we recommend using Internet Explorer 11.

所以我认为最好的解决方案是尝试在 Windows Server 2016 上使用 IE 11。

-------------------------------------------- - - - - - - - - 编辑 - - - - - - - - - - - - - - - - - --------------------------

对于 Microsoft Edge Chromium,您可以参考注册表项 DefaultPluginsSetting and PluginsAllowedForUrls。来自 DefaultPluginsSetting 中的解释:

The PluginsAllowedForUrls policies take precedence over DefaultPluginsSetting. If you want to enable automatic playback for all sites, consider adding http://* and https://* to this list.

所以我们只需要在路径下的注册表中添加值:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\PluginsAllowedForUrls

值如下:

结果在 Microsoft Edge Chromium 中是 like this。从文档中,支持的版本是 Microsoft Edge on Windows 和 Mac 自版本 77 或更高版本。您可以在 Windows Server 2016 中尝试。