Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetVisibleNavigationEntry always returns null #2986

Closed
Pethical opened this issue Dec 9, 2019 · 5 comments
Closed

GetVisibleNavigationEntry always returns null #2986

Pethical opened this issue Dec 9, 2019 · 5 comments
Milestone

Comments

@Pethical
Copy link

Pethical commented Dec 9, 2019

  • What version of the product are you using?

NuGet 75.1.143

  • What architecture x86 or x64?

x64 & x86

  • On what operating system?

Win10

  • Are you using WinForms, WPF or OffScreen?

WPF & WinForms

  • What steps will reproduce the problem?
  1. Load a valid website into the browser
  2. Execute the next statement:
var entry = browser.GetBrowserHost().GetVisibleNavigationEntry();
  • What is the expected output? What do you see instead?

Current: null returned
Expected: return the current visible entry

  • Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)

No

Not acceptable / can't test with the sample


Regards,
Peter

@amaitland
Copy link
Member

Please provide a more detailed example. When and on what thread are you calling the method?

@Pethical
Copy link
Author

Pethical commented Dec 9, 2019

@amaitland
Copy link
Member

As per the documentation you can only call GetVisibleNavigationEntry on the CEF UI thread.

http://cefsharp.github.io/api/75.1.x/html/M_CefSharp_IBrowserHost_GetVisibleNavigationEntry.htm

You can use http://cefsharp.github.io/api/75.1.x/html/P_CefSharp_Cef_UIThreadTaskFactory.htm to access the CEF UI thread.

@amaitland amaitland added this to the 79.0.0 milestone Dec 9, 2019
@amaitland
Copy link
Member

An exception will now be throw when calling from the incorrect thread, relevant commit 99c177a

@Pethical
Copy link
Author

Pethical commented Dec 9, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants