问题
I have winforms application that contains cefsharp ChromiumWebBrowser component. I want JAWS to read it's content. Now JAWS only read title of main window. Is there any way to achieve this? I tried "force-renderer-accessibility" flag but it didn't help me.
Here is the code i tried:
var settings = new CefSettings()
{
CefCommandLineArgs = { new KeyValuePair<string, string>("force-renderer-accessibility", "true") }
};
Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);
回答1:
Following amaitland's prompting above we found the following solution.
Disable MultiThreadedMessageLoop - you then need to periodically invoke DoMessageLoopWork as per the crude sample below.
var settings = new CefSettings()
{
MultiThreadedMessageLoop = false
};
Cef.Initialize(settings);
browser = new ChromiumWebBrowser ("https://url.com/");
var t = new Timer {Interval = 5};
t.Start();
t.Tick += t_Tick;
this.panel1.Controls.Add(browser);
}
void t_Tick(object sender, EventArgs e)
{
this.BeginInvoke((Action) (() => Cef.DoMessageLoopWork()));
}
来源:https://stackoverflow.com/questions/42163764/how-to-make-jaws-screen-reader-recognize-and-read-content-of-cefsharp-chromiumwe