I need to disable Flash Player. I tried to do this through the RequestContextHandler, but it did not work:
public class RequestContextHandler : IRequestContextHandler
{
public ICookieManager GetCookieManager()
{
return null;
}
public bool OnBeforePluginLoad(string mimeType, string url, bool isMainFrame, string topOriginUrl, WebPluginInfo pluginInfo, ref PluginPolicy pluginPolicy)
{
bool blockPluginLoad = pluginInfo.Name.ToLower().Contains("flash");
return blockPluginLoad;
}
}
Whoer.net shows that Flash is not disabled.
How I can disable "pepflashplayer" plugin?
Аlso need to configure the plugin policy:
public class RequestContextHandler : IRequestContextHandler
{
public ICookieManager GetCookieManager()
{
return null;
}
public bool OnBeforePluginLoad(string mimeType, string url, bool isMainFrame, string topOriginUrl, WebPluginInfo pluginInfo, ref PluginPolicy pluginPolicy)
{
bool blockPluginLoad = pluginInfo.Name.ToLower().Contains("flash");
if (blockPluginLoad)
{
pluginPolicy = PluginPolicy.Disable;
}
return blockPluginLoad;
}
}
Thanks to @stuartd
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.