Replies: 1 comment
-
Firstly, using the file scheme is not something I recommend or provide support for. https://github.com/cefsharp/CefSharp/wiki/General-Usage#file-uri-file Your html code is incomplete, so it's impossible to say. Could be a timing issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CefSharp Version
130.1.90
Operating System
Windows 11
Architecture
x86
.Net Version
.NET Framework 4.6.2
Implementation
WinForms(Vb.net)
Reproduction Steps
1.Install CefSharp.Winforms,CefSharp.common 130.1.90 from Nuget
2.Put HTML finle in folder : D:\test folder
3.Build code with x86
Winforms code
Dim settings As New CefSettings()
settings.LogSeverity = LogSeverity.Verbose
settings.LogFile = Path.Combine(Application.StartupPath, "logs", "cefsharp.log")
Cef.Initialize(settings)
Dim appPath As String = AppDomain.CurrentDomain.BaseDirectory
Dim filePath As String = System.IO.Path.Combine(appPath, "", "test.html")
Dim uri As String = New Uri(filePath).AbsoluteUri
browser = New ChromiumWebBrowser(uri)
Me.Controls.Add(browser)
browser.Dock = DockStyle.Fill
browser.JavascriptObjectRepository.Register("dotNetObj", New DotNetToJs(), isAsync:=False)
HTML code
document.addEventListener("DOMContentLoaded", async function () {
await CefSharp.BindObjectAsync("dotNetObj");
console.log("dotNetObj is ready!");
}
function callDotNet() {
if (typeof dotNetObj !== "undefined") {
dotNetObj.showMessage("Hello from JavaScript!");
}
}
Execute Result
Intel CPU notebook can get public function dotNetObj .
AMD CPU notebook can not get public function : dotNetObj show not available.
Beta Was this translation helpful? Give feedback.
All reactions