-
Notifications
You must be signed in to change notification settings - Fork 449
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
HasDocument never returns True for InertiaJS Applications #3682
Comments
Where in your code are you testing This status/callback is based on Chromium calling WebContentsObserver::PrimaryMainDocumentElementAvailable. If that's not working then it would be some issue in Chromium, and you would need to build/debug the Chromium code to figure out what, exactly, is going wrong. |
Ok THIS behaves strangely. OnDocumentAvailableInMainFrame does get called and if i use that
The issue seems to be that the browser I get in that callback differs from the one that we cache (m_browser) from OnAfterCreated. So to summarize, |
You can't compare CefRefPtr<> directly. What does |
Ah of course, they're ref counted. So this code:
Results in this printout:
|
OK, so the issue looks like your timing of the HasDocument call. I suggest you use the OnDocumentAvailableInMainFrame callback instead, for better reliability. |
I'm polling the cached browser every frame and it's False before and long after the callback from OnDocumentAvailableInMainFrame. It doesn't seem like I'm mis-timing it. |
From where exactly? |
From our application's main loop. Once the browser's loaded and we get OnAfterCreated called, we stash the m_browser instance to communicate with the browser during its lifetime. So we're polling m_browser->IsLoading() and m_browser->HasDocument() to know when everything's finally ready. |
You might run in a debugger to see if CefBrowserContentsDelegate::DidFinishNavigation is setting |
After the call to OnDocumentAvailableInMainFrame for same (main) frame? |
It's definitely after OnDocumentAvailableInMainFrame though I'm not exactly sure how to compare the frames properly. |
Hello! I still assert this is a bug and should be reopened. I believe the HasDocument accessor exists to be "polled" so that events such as OnDocumentAvailableInMainFrame don't have to be tracked and cached by the client. Is there more information I can get you to aid in resolving this? It's currently preventing our application from working and while we can and will cache the value from OnDocumentAvailableInMainFrame, I'd like to see HasDocument fixed so we can go back to polling in the near future. |
Agreed. |
It seems like CEF does not like applications built with InertiaJS. Our application, even a very barebones test application seems to load fine with even the latest CEF (123.0.8) but CefBrowser::HasDocument always returns False. I've tried this on Mac and Windows builds and both display the same behavior. I should also mention that HasDocument seems to be working fine for every other website I throw at is, so long as it's not an InertiaJS application.
Steps to reproduce the behavior:
Windows 10 and MacOS 14.4
CEF (123.0.8)
The text was updated successfully, but these errors were encountered: