Availability of registered JS callbacks

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Availability of registered JS callbacks

Postby winapiwrapper » Tue Mar 13, 2018 2:43 pm

Hello everyone,

I need to register a few JS callbacks using C++.

Are they guaranteed to be available before my page is fully loaded?
I'm currently calling a callback on the Javascript window.onload event, and of course it works, but I'd like to call it before (as soon as my script is loaded). Can I do that safely?
winapiwrapper
Techie
 
Posts: 35
Joined: Sat Feb 24, 2018 10:27 am

Re: Availability of registered JS callbacks

Postby magreenblatt » Tue Mar 13, 2018 3:04 pm

If you register the callbacks in OnContextCreated they will be available before any JS is executed in the frame.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Availability of registered JS callbacks

Postby winapiwrapper » Tue Mar 13, 2018 3:08 pm

Yes, I do register them in OnContextCreated.

Thank you very much!
winapiwrapper
Techie
 
Posts: 35
Joined: Sat Feb 24, 2018 10:27 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 86 guests