How to make JAWS screen reader recognize and read content of cefsharp ChromiumWebBrowser control?

荒凉一梦 提交于 2019-12-10 19:17:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!