cefsharp 相关问题

用于Chromium Embedded Framework的.NET(WPF和Windows Forms)绑定

能够在请求级别设置 CefSharp 代理

有人可以告诉我,当特定资源请求时,我是否可以在“OnBeforeResourceLoad”下的请求级别使用 Cef.UIThreadTaskFactory.StartNew 方法在运行时设置 CefSharp 代理...

回答 1 投票 0

允许用户使用cefsharp浏览器通过鼠标滚轮进行缩放

我正在运行cefsharp/75。我想使用 ctrl 键和鼠标滚轮打开缩放功能。我的事件处理程序从未被触发。如果你按住 ctrl 并使用鼠标,屏幕不会移动......

回答 3 投票 0

Windows 应用程序中 108.4.130 版本更新后的 Cefsharp UI 问题

我们有一个Windows应用程序,我们在其中使用cefsharp打开chrome浏览器来显示一些数据。它在 cefsharp 版本 75.1.14 上运行良好。但最近作为 Angular 14 更新的一部分......

回答 2 投票 0

Cefsharp如何显示新添加的PrintPreview

我目前正在评估 Cefsharp 的 Projekt。现在我想知道如何显示打印预览(与 Chrome 中相同),您可以通过以下方式启用: var 设置 = new CefSettings(); 设置。

回答 3 投票 0

CefSharp - 更改加载屏幕背景颜色

是否可以更改 CEFSharp 上的加载屏幕颜色。与 Chrome 一样,当加载新的 url 时,它将显示一个白色页面,直到加载并呈现为止。是否可以更改此加载列...

回答 4 投票 0

使用 Devexpress Ribbonform 与 Cefsharp 浏览器将窗口调整为更小的尺寸

我最近使用 devexpress winforms 控件创建了一个简单的ribbonform应用程序。只需查看图像即可了解发生了什么。每次调用 cef.initialize 时,窗口都会调整大小并变为

回答 1 投票 0

无法加载文件或程序集CefSharp.Core.Runtime

我使用NuGet包管理器安装https://github.com/cefsharp/CefSharp 将该项目添加到我的 .csproj 我使用NuGet Package Manager安装https://github.com/cefsharp/CefSharp 这将项目添加到我的.csproj <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> <UseWPF>true</UseWPF> </PropertyGroup> <ItemGroup> <PackageReference Include="CefSharp.Wpf" Version="87.1.132"/> </ItemGroup> </Project> 接下来我修改了我的 xaml 文件,如下所示: <Window x:Class="csharp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:csharp" xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <wpf:ChromiumWebBrowser x:Name="webBrowser" Address="http://localhost:4200"> </wpf:ChromiumWebBrowser> </Grid> </Window> 最后,我在 App.xaml.cs 文件中添加了以下构造函数: namespace csharp { public partial class App : Application { public App() { var settings = new CefSettings() { // Line 12 CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache") }; settings.CefCommandLineArgs.Add("enable-media-stream"); settings.CefCommandLineArgs.Add("use-fake-ui-for-media-stream"); settings.CefCommandLineArgs.Add("enable-usermedia-screen-capturing"); var dependencyCheck = true; Cef.Initialize(settings, performDependencyCheck: dependencyCheck, browserProcessHandler: null); } } } 当我运行该应用程序时,出现以下错误: Exception has occurred: CLR/System.BadImageFormatException An unhandled exception of type 'System.BadImageFormatException' occurred in CefSharp.Wpf.dll: 'Could not load file or assembly 'CefSharp.Core.Runtime, Version=87.1.132.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'. An attempt was made to load a program with an incorrect format.' at CefSharp.CefSettingsBase..ctor() at CefSharp.Wpf.CefSettings..ctor() at csharp.App..ctor() in App.xaml.cs:line 12 at csharp.App.Main() 为什么无法加载包? 编辑: 这是更新后的新文件结构: 它使用了正确的dll吗?我最初的猜测是程序架构和使用的 CefSharp.Core.dll 之间不匹配,例如该程序以 64 位模式运行,但引用 32 位程序集。 可以升级到netcoreapp3.1吗?如果是,则切换到 https://www.nuget.org/packages/CefSharp.Wpf.NETCore/ 应该可以解决问题。 BadimageformatException 在加载 C++/CLI 程序集的上下文中相当具有误导性,任何失败都会给出此异常。请参阅 https://github.com/dotnet/runtime/issues/31743#issuecomment-582168696 了解背景信息。 如果您需要继续使用 netcoreapp3.0,那么您需要在项目文件中指定 PlatformTarget 或 RuntimeIdentifier。

回答 2 投票 0

cefsharp DownloadUrlAsync 跳过 Cookie

在浏览器控件中加载需要cookie和authentiacaion的url就可以了 CefSharp.OffScreen.ChromiumWebBrowser 浏览器 = new CefSharp.OffScreen.ChromiumWebBrowser(Url, requestContext: reqContext)...

回答 1 投票 0

CefSharp.WinForms 错误(GPU 进程意外退出:exit_code=-532462766)

我是第一次设置 CefSharp。我已经安装了 NuGet CefSharp.WinForms 版本 99.2.90。我已经在 x64 和 x86 版本中运行了它。 x64 抛出了一个 DLL 错误,这表明它应该是...

回答 2 投票 0

如何填写网络表单并使用 CefSharp 提交

我正在尝试使用CefSharp,目前似乎工作正常。 我想填写一份表格(这是一个登录表格)并提交表格,知道我该怎么做吗? 我发现有一个 ExecuteScriptAsync,但是

回答 1 投票 0

CEF - 使用 Chromium 嵌入式框架时某些字体图标不可见

我们在 WPF 应用程序中托管 CEF,并使用 CefSharp 作为我们的一个应用程序,该应用程序的 UI 是使用 ExtJs 6.7.0 构建的。一切似乎都工作正常,除了某些字体图标在您看不到时......

回答 1 投票 0

如何在CefSharp中以树形结构显示XML

如何使用 CefSharp WinForms 来像 Chrome 那样显示普通 XML 文件(具有可折叠、可点击的节点)?我怀疑 LoadHtml() 可能不是正确的方法...... 示例 XML ...

回答 1 投票 0

CefSharp html 加载超过 2097152 个字符

我在winform中使用CefSharp来显示一个html页面,其中我有一些数据要传递和显示。这是代码: 私人 CefSharp.WinForms.ChromiumWebBrowser chromiumWebBrowser1; 字符串 html = 实用程序。

回答 1 投票 0

如何通过vb.net CefSharp在同一个窗口中打开不同页面

我在form1中创建控件ChromiumWebBrowser1。并在ChromiumWebBrowser1中打开链接www.baidu.com页面。 现在我在页面中找到了更多链接。我再次单击这些链接, 不幸的是这些网站...

回答 2 投票 0

如何设置 --allow-file-access-from-files 到 cefsharp wpf?

我会测试 Cefsharp,但我不知道在哪里设置 --allow-file-access-from-files 我努力了 我会测试 Cefsharp,但我不知道在哪里设置 --allow-file-access-from-files 我试过了 <Window x:Class="Chromium.MainWindow" xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Chromium" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <cef:ChromiumWebBrowser x:Name="browser" IsBrowserInitializedChanged="browser_IsBrowserInitializedChanged"></cef:ChromiumWebBrowser> </Grid> </Window> private void browser_IsBrowserInitializedChanged(object sender, DependencyPropertyChangedEventArgs e) { browser.LoadUrl("file:///C:/index.html"); } 但这不好..有接受本地文件的解决方案吗? 在本地文件 index.html 中,我正在使用 d3.son()(库 d3.js)加载本地 json 文件(与 index.html 在同一文件夹中的 json) <script src="https://d3js.org/d3.v4.min.js"></script> <script> : : var link = svg.append("g").selectAll(".link"), node = svg.append("g").selectAll(".node"); d3.json("flare.json", function (error, classes) { : 显示的错误: “从原点‘null’访问‘file:///C:/flare.json’处的 XMLHttpRequest 已被 CORS 策略阻止:跨源请求仅支持协议方案:http、数据、chrome-extension、chrome , https, chrome-untrusted.", 来源: file:///C:/index.html (0) 我从 Process.Start 调用没有问题: var p = System.Diagnostics.Process.Start("chrome.exe", "\"file:///C:/index.html\" --allow-file-access-from-files"); 其实很简单: 只需在构造函数中执行此操作: var settings = new CefSettings(); settings.CefCommandLineArgs.Add("allow-file-access-from-files"); settings.CefCommandLineArgs.Add("allow-universal-access-from-files"); Cef.Initialize(settings);

回答 1 投票 0

为什么 CefSharp.Cef.get_IsInitialized() 语句在 Windows 2012 中运行失败?

我在Windows Server 2012 R2上安装了108版本的Chrome(新版本无法安装),然后跑了一个用C#写的CEF程序。但是,我收到一条错误消息,指出

回答 0 投票 0

使用Chrome Cef浏览器时如何加载chrome的默认配置文件

我是基于 Chromium 的 c# 浏览器的新手;浏览器本身可以工作,但我想要的是每次用户启动浏览器时浏览器都不会以隐身模式启动。我试过...

回答 0 投票 0

CefSharp Visual Studio 2022

如果站点提供下载文件,我如何添加到此代码 CefSharp,它下载到文件夹 C:/Gwlo/Common,如果没有文件夹,它创建它?下载后它也会打开......

回答 0 投票 0

我如何检测弹出窗口是 Cefsharp 中的 PrintDialog

我想知道如何在 Cefsharp 中检测到 Popup 窗口是 PrintDialog,现在我在 if 子句中有这种情况,但它没有检测到 Popup 是 PrintDialog,我不知道。 ..

回答 0 投票 0

在 C# 中是否有替代 cefsharp 的方法?自己编译和别人编译的最新版和cefsharp不能播放mp4视频

我想请教一个问题。我想用支持winforms的浏览器内核播放视频文件。我在这里使用谷歌的cefsharp。由于mp4文件的版权问题,谷歌不提供...

回答 0 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.