cefsharp

CefSharp WebBrowser Example in WPF (transparency)

三世轮回 提交于 2019-12-23 04:22:01
问题 I'm working with WPF and c# (using Visual Studio 2013) and I want to develop an application with a transparent background and a webbrowser. I understand that this is an issue of the default webbrowser... but I want to find another solution. I found other webbrowser components like CefSharp that is based on chromium. I'd like to know if is possible using a transparent background using the CefSharp browser and I'd like that someone explain me step by step how to implement a very simple

How to receive drag move and drag drop events using CefSharp winforms

偶尔善良 提交于 2019-12-23 01:42:18
问题 I am using the windowsformshost and trying to get dragover and drop events. I have set allowdrop on the WPF window, Windowsformshost and the ChromiumWebBrowser. I can understand that the WPF window will not get the event due to the windowsformshost airspace issues. But I dont understand why the windowsformshost or the ChromiumWebBrowser does not get any of the events. It appears they are swallowed and not passed on by CEF/CefSharp. How can I handle the events and/or what do I need to disable

C# CefSharp Offscreen mouse events, keyboard events emulating example

谁说胖子不能爱 提交于 2019-12-22 11:27:44
问题 Anybody can show me example(C#) of CefSharp.OffScreen browser mouse and keyboard events emulating? Sorry about my english... For example: mouse down on screen x=100,y=100....move to x=200,y=200 and mouse up. After press 'Enter' key. Thanks. 回答1: Stumbled upon this 2y 6m later and wanted to put it out to someone who might be in the same position. Solution includes usage of CefSharp framework and JavaScript execution via CefSharp . //1. Find the Html element x and y coordinates with something

使用cefsharp在winform中嵌套浏览器

帅比萌擦擦* 提交于 2019-12-21 20:27:36
1. 创建winform程序 2. 在项目中,右击引用,选择nuget包,引入cefsharp.winforms包 3. 更改winform生成配置,之前的cefsharp.winforms不支持anyCPU配置,现在支持了 右击项目,选择属性,选择生成,更改生成配置勾上“32位优先” 4. 更改项目的csproj文件,添加 <CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport> 5. 更改项目中的App.config文件,添加: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="x86"/> </assemblyBinding> </runtime> 6. 使用cefsharp: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

How to implement keyboard handler cefSharp for shortcut keys

老子叫甜甜 提交于 2019-12-21 17:24:10
问题 I've building a windows app for browsing web pages using cefSharp . I need to implement some short cut keys into that application, can any one tell me how can i achieve this functionality. Ex. ctrl + tab = move to next tab I'm able to track if user presses any single key, but unable to track multi key pressing. IKeyboardHandler public class KeyboardHandler : IKeyboardHandler { public bool OnKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int

Separate cache per browser?

二次信任 提交于 2019-12-21 17:16:09
问题 Currently I'm setting the cache path as follows: CefSettings settings = new CefSettings(); settings.CachePath = mycachePath; Cef.Initialize(settings); var browser = new ChromiumWebBrowser(myUrl); The above works. However, I need to login to a website with 2 different accounts simultaneously but it uses the same cookie container. So if I login with one account and then the other, the first account is overridden. Is it possible to have a have a cache path per browser? Or is there a better way

How do I hide the CefSharp.WinForms.ChromiumWebBrowser right click context menu?

不想你离开。 提交于 2019-12-21 07:04:09
问题 I'm using CefSharp.WinForms.ChromiumWebBrowser v45 in my project. When I right click into the web browser, the default context menu will show up: But I don't want to show anything. What should I do? 回答1: This is the implementation for lazy people like me. It is based on CefSharp v53.0.0 public class CustomMenuHandler : CefSharp.IContextMenuHandler { public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) {

CefSharp WpfControl and rendering to image

做~自己de王妃 提交于 2019-12-20 06:27:18
问题 We want to show a webpage in a chromium based browser within a wpf application. The website that is displayed within the browser should also be shown on another screen but without interaction. I want to combine the cefsharp wpf browser control and the cefsharp offscreen rendering. Can I use one chromium instance for displaying the page with interactions in wpf and export the current visible website as an image? Thank you and best regards, Simon 回答1: Thank you amatiland, it indeed works with

How to trap/listen javascript function or events in cefsharp

本小妞迷上赌 提交于 2019-12-20 02:52:44
问题 I am trying to use cefSharp for a WPF application. I can find "how to call a Javascript methods from .Net. But is there a way where I can get notified for Javascript functions or events in .Net? e.g. if there is a Javascript function (with and without param) I can get the notification with or without values in .Net. 回答1: In short, YES! There's bindings available for: c# -> js use webBrowser.ExecuteScriptAsync(script); js -> c# use webBrowser.RegisterJsObject(A_NAME_FROM_JS, objectToBind);

CefSharp开发

一笑奈何 提交于 2019-12-18 12:55:52
CefSharp是用chromium内核开发的.net版本浏览器工具。目前只支持X86模式。所以在调试的时候要把平台改为X86 CefSharp开发指引:https://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application 1、C#调用js private void btnAlert_Click(object sender, EventArgs e) { this.browser.GetBrowser().MainFrame.ExecuteJavaScriptAsync("alert('这是c#调用的js,给文本框赋值!')"); //txtAccount this.browser.GetBrowser().MainFrame.ExecuteJavaScriptAsync("document.getElementById('txtAccount').value='在C#里面给页面文本框进行赋值'"); } 2、js调用C# 首要要创建被调用的C#对象和方法,注意方法名要小写,大写的时候,会调用失败! public class CefAsyncJS { private string LoginAccount