cefsharp

How can I force a TabItem to initialize content on load?

跟風遠走 提交于 2019-12-06 02:10:25
问题 [disclaimer: I am new to Visual Basic.] In a WPF, I have a TabControl containing 2 TabItems: The first TabItem contains a bunch of URLs. The second TabItem consists of a DockPanel that contains a cefSharp webView (chromium embedded for .net) When I click on a url in tab1 it loads a page in the browser contained in tab2... But, it only works if I have initialized the browser first by clicking on tab2. After doing some searching, it looks like vb.net doesn't initialize the content in a TabItem

关于winform打包后,显示 CefSharp.core.dll 找不到指定的模块的解决方案。

▼魔方 西西 提交于 2019-12-05 22:38:27
为什么我得到一个错误有关“无法加载文件或程序集 CefSharp.Core.dll ”或它的一个依赖。指定的模块找不到。“当试图运行基于我CefSharp的应用程序?它编译成功,但不运行?它运行我的开发机器上,虽然抛出一个异常,当我把它复制到另一台计算机? 请先查看 官方解释 根据解释得到,我们需要先检查打包后的文件夹是否有这些文件,否则需要手动拷贝。 在引用完cef时,重新生成项目后,会得到两个文件夹: 这两个文件就基本包含了cef所有必备文件,所有东西准备好了,现在开始正式打包吧。 1.创建安装程序项目 本人使用的是 Visual Studio Installer ,没有的小伙伴请自行安装扩展。 然后将目标架构改为 x64 2.导入项目主输出 右键setup 选中 view > 文件系统 ,然后选中 Application Folder 在空白位置右键 Add>项目输出 选择你的项目,配置改为 Release Any CPU. 导入的主输出,不出意外应该有3个cef相关组件,首先将其排除,当前输出不能包含任何cef项目。 选中3个,固定属性窗体,将 Exclude 改为 True 就可以排除这些文件了。 现在将文章开头提到的两个文件夹 复制到新的位置,再复制到打包项目中。直接复制,本人这里会提示 拒绝访问 ,所有,我将它拷贝到了新位置后再复制。 到这里就不会再出现

Cef Browser Wpf explore the dom, find elements and change values

与世无争的帅哥 提交于 2019-12-05 16:06:49
Further to a post ( CefSharp load a page with browser login ). I implemented the IRequestHandler interface and the different methods, particularly the GetAuthCredentials where I show a dialog and recover user and password and passing it to the event handler. Now I want to access to the dom where I get several frameset with differents frames and I'm interested in one frame which I know the name Atribute. Inside this frame I need to get list of different type of input , select etc... In my app I have a button which I use to set values of the different elements depending if they are present on

CEfSharp下载文件 弹出保存框,实现 IDownloadHandler 接口

北城以北 提交于 2019-12-05 15:43:08
上节讲了如何将CefSharp集成到C#中,但集成后将web界面链接进ChromiumWebBrowser后,但web界面上下载附件的功能不好使咯。 百度了半天还是没搞定,只能去看官网的Excample和源代码,最后瞎猫碰死耗子给搞定了,需要去实现一个接口。 public RevenueContractFrmWeb(Adapter adapter) { Adapter = adapter; InitializeComponent(); //string url = GlobalDefination.Urlex + "/go-logistics-client/inAndOutPages/incomeContract/contractMg/ContractMain.jsp"; //webBrowser.Navigate(url+"?sessionId=" + adapter.SessionId); string url = GlobalDefination.Urlex + "/go-logistics-client/inAndOutPages/incomeContract/contractMg/ContractMain.jsp?sessionId=" + adapter.SessionId; CefSharp.WinForms.ChromiumWebBrowser wb = new

CefSharp 屏蔽右键菜单

陌路散爱 提交于 2019-12-05 15:42:52
既然是C#+web混用模式,当然就需要把web的右键操作屏蔽掉咯。废话不说了直接上代码。 internal class MenuHandler : IMenuHandler { public bool OnBeforeContextMenu(IWebBrowser browser, IContextMenuParams parameters) { return false; } } 调用方式: string url = "http://www.baidu.com"; CefSharp.WinForms.ChromiumWebBrowser wb = new CefSharp.WinForms.ChromiumWebBrowser(url); wb.Dock = DockStyle.Fill; this.Controls.Add(wb); wb.MenuHandler = new MenuHandler(); 搞定 这样就没有右键菜单咯 出处: https://blog.csdn.net/weiyongliang_813/article/details/50575725 来源: https://www.cnblogs.com/mq0036/p/11932241.html

使用CefSharp前端后台交换

痴心易碎 提交于 2019-12-05 04:19:28
原文: 使用CefSharp在.NET中嵌入Google kernel   使用CefSharp可以在.NET轻松的嵌入Html,不用担心WPF与Winform 控件与它的兼容性问题,CefSharp大部分的代码是C#,它可以在VB或者其他.NET平台语言中来进行使用。   近几天来,公司项目中需要使用 WebBrowser, 其中考虑了几个控件,如 1.Winform中的WebBrowser 2.WPF中的WebBrowser 3.WebKit.Net 4.CefSharp   Winform的WebBrowser放到项目中进行了实验和处理,发现致命问题:AllowsTransparency = true 和 Webbrowser 等内置窗体显示冲突,导致不发选择,还有就是GC回收不及时,一下子就飙到了100MB+.   后来考虑WPF的webbrowser 它实际上还是封装了Winform,有个严重的问题就是它一直置顶到最顶层,so,无法选择。   再后来考虑 WebKit.Net , 但发现已经N多年没有更新,所以不在考虑...   最后跌跌撞撞跑到CefSharp,发现非常的坑啊!!竟然不支持 AnyCPU,关键是我的项目中有的功能是必须AnyCpu启动的啊!还好,官方在去年已经公布了支持AnyCpu的方法。   首先Nuget引用cefsharp.WPF

Separate cache per browser?

天涯浪子 提交于 2019-12-04 08:43:53
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 to handle this situation? It looks like you're using CefSharp ? If so, looking through the code, it

How to implement keyboard handler cefSharp for shortcut keys

寵の児 提交于 2019-12-04 08:20:38
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 nativeKeyCode, CefEventFlags modifiers, bool isSystemKey) { bool result = false; Debug.WriteLine(String.Format(

How to enable Adobe Flash with CefSharp?

不问归期 提交于 2019-12-04 08:13:29
I'm using the latest Version of CefSharp and I need to Display Flash. When using Chrome, the page gets displayed correctly. However when using CefSharp it does not. So far I tried: var browser = new ChromiumWebBrowser(URL) { BrowserSettings = new BrowserSettings() { Java = CefState.Enabled, Plugins = CefState.Enabled, }, Dock = DockStyle.Fill }; When I load about:plugins I get: CEF 3.2357.1287.g861c26e Chromium 43.0.2357.130 OS Windows WebKit 537.36 JavaScript 4.3.61.30 Flash User Agent Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari

What is the purpose of the cef.pak file in cefsharp?

非 Y 不嫁゛ 提交于 2019-12-04 06:51:42
In the FAQs of CefSharp , it states that you should disable Package Loading: var settings = new CefSharp.CefSettings { PackLoadingDisabled = true }; which is normally OK for a production-mode application I have an issue where on a particular website a red border is appearing around a drop-down box. If I set PackLoadingDisabled = false and ensure that the cef.pak file is in the folder (This cef.pak is distributed with the CefSharp nuget package. I am not including any other .pak file except locates/en-US.pak) then this fixes the issue. My question is, What purpose does this cef.pak file serve?