mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +00:00
Change PluginVisitor to set the TaskCompletionSource to an empty list when Visit is never called
Slightly nicer behaviour than timing out Update the example
This commit is contained in:
@@ -196,10 +196,19 @@ namespace CefSharp.Example
|
||||
pluginBody.Append("<th>Path</th>");
|
||||
pluginBody.Append("</tr>");
|
||||
|
||||
try
|
||||
{
|
||||
var plugins = await Cef.GetPlugins();
|
||||
var plugins = await Cef.GetPlugins();
|
||||
|
||||
if(plugins.Count == 0)
|
||||
{
|
||||
pluginBody.Append("<tr>");
|
||||
pluginBody.Append("<td colspan='4'>Cef.GetPlugins returned an empty list - likely no plugins were loaded on your system</td>");
|
||||
pluginBody.Append("</tr>");
|
||||
pluginBody.Append("<tr>");
|
||||
pluginBody.Append("<td colspan='4'>You may find that NPAPI/PPAPI need to be enabled</td>");
|
||||
pluginBody.Append("</tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var plugin in plugins)
|
||||
{
|
||||
pluginBody.Append("<tr>");
|
||||
@@ -210,15 +219,6 @@ namespace CefSharp.Example
|
||||
pluginBody.Append("</tr>");
|
||||
}
|
||||
}
|
||||
catch (TaskCanceledException ex)
|
||||
{
|
||||
pluginBody.Append("<tr>");
|
||||
pluginBody.Append("<td colspan='4'>Cef.GetPlugins Timed out - likely no plugins were loaded on your system</td>");
|
||||
pluginBody.Append("</tr>");
|
||||
pluginBody.Append("<tr>");
|
||||
pluginBody.Append("<td colspan='4'>You may find that NPAPI/PPAPI need to be enabled</td>");
|
||||
pluginBody.Append("</tr>");
|
||||
}
|
||||
|
||||
pluginBody.Append("</table></body></html>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user