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

Fixed RegisterJavascriptObject #186

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fixed RegisterJavascriptObject #186

wants to merge 3 commits into from

Conversation

sakya
Copy link

@sakya sakya commented Nov 7, 2024

Fix #185

Registered objects are only valid in the current page.
We should re-register all the objects when the page is loaded

@@ -599,6 +599,8 @@ void ICefBrowserHost.HandleLoadStart(CefBrowser browser, CefFrame frame, CefTran

void ICefBrowserHost.HandleLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
{
// Register all objects
_objectRegistry.SetBrowser(browser);
Copy link

@AndreBooysen AndreBooysen Dec 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my scenario I needed to make sure that the objects are already registered during the page load, so I called this method inside HandleLoadStart instead.

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

Successfully merging this pull request may close these issues.

RegisterJavascriptObject works only on first page loaded
2 participants