Can'not change browser settings in CefSharp >> getting the error ("BrowserSettings" not found)

1,828 views
Skip to first unread message

Aurora

unread,
Dec 17, 2014, 5:37:48 PM12/17/14
to cefs...@googlegroups.com

I wanted to access files using file:/// and for that I would need to change BrowserSettings (FileAccessFromFileUrlsAllowed).  I tried uncommenting the section in BrowserTabView.XAML (or .cs) [highlighted] but it gives me the following error!

How do I do that? I am using WPF example project. 


Jørn Hansen

unread,
Dec 17, 2014, 6:27:17 PM12/17/14
to cefs...@googlegroups.com
WebView was renamed into ChromiumWebBrowser quite some time ago - but apparently not in that commented out example.

Aurora

unread,
Dec 17, 2014, 6:38:11 PM12/17/14
to cefs...@googlegroups.com
Thanks for replying. After renaming it to "ChromiumWebBrowser" now I am getting the error - The attachable property BrowserSettings was not found in "ChromiumWebBrowser".
How do I change Browser settings?

Thanks

Jørn Hansen

unread,
Dec 17, 2014, 7:17:15 PM12/17/14
to cefs...@googlegroups.com
What version are you building? There was this issue reported with a fix applied after v33 to setting it In C# code: https://github.com/cefsharp/CefSharp/issues/572

I'm not sure if someone has tested setting it in XAML recently. If you can verify setting it in code works that's one step. Preferably we should have it verified with XAML too. please dig a bit around and of you can't get both ways working with current master file a GitHub issue or PR if you can. (waaay over my bedtime here now :-)

Best regards,
JornH

Aurora

unread,
Dec 18, 2014, 6:25:45 PM12/18/14
to cefs...@googlegroups.com
I tried doing it from the C Sharp code and it woks with win forms project but NOT with wpf project!
           CefSharp.BrowserSettings browser_setting = new CefSharp.BrowserSettings();
            browser_setting.FileAccessFromFileUrlsAllowed = true;
            browser_setting.UniversalAccessFromFileUrlsAllowed = true;
            browser_setting.WebSecurityDisabled = true;
            browser.BrowserSettings = browser_setting;

In the Winforms it works but in the WPF it doesnt!

Thanks
Reply all
Reply to author
Forward
0 new messages