I need to Enable/Disable Flash for Edge pragmatically in C#. I googled the registry key which are below, but none of them works to enable Flash on Edge. Can someone tell me that what registry key is get used to to enable Flash on Edge on Windows 2016.
HKEY_CURRENT_USER \ SOFTWARE \ Classes \ Local Settings \ Software\Microsoft\Windows\CurrentVersion\AppContainer \ Storage \ microsoft.microsoftedge_8wekyb3d8bbwe \ MicrosoftEdge \ Addons\
and set the FlashPlayerEnabled = 1.
another one is:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Addons
and set the FlashPlayerEnabled = 1.
First, the second approach in your question is right. I've tested it on Microsoft Edge 44.18362.1.0 on Windows 10 and it works. The approach is also listed in official docs. But we also need to notice that the supported versions is Microsoft Edge on Windows 10.
Second, Microsoft Edge is not supported on Windows Server 2016. It might be many features not supported even though you have successfully installed Microsoft Edge on Windows Server 2016. This might be the reason why the registry not working on Windows 2016 and I don't see there's a solution for this. From this doc, we can see:
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.
So I think the best solution is trying to use IE 11 on Windows Server 2016.
-------------------------------------------------------------Edit-------------------------------------------------------------
For Microsoft Edge Chromium, you could refer to the registry key DefaultPluginsSetting and PluginsAllowedForUrls. From the explanation in DefaultPluginsSetting:
The PluginsAllowedForUrls policies take precedence over DefaultPluginsSetting. If you want to enable automatic playback for all sites, consider adding
http://*
andhttps://*
to this list.
So we only need to add values in registry under path:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\PluginsAllowedForUrls
The values are like below:
And the result is like this in Microsoft Edge Chromium. From the docs, the supported versions are Microsoft Edge on Windows and Mac since version 77 or later. You could have a try in Windows Server 2016.