OnLoadStart - not always called

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.

OnLoadStart - not always called

Postby Staxcelrom » Sat May 21, 2022 4:22 am

Hello,

I noticed that for some cases OnLoadStart is not called.

Here is one of the cases:

Code: Select all
   void OnLoadStart(CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefLoadHandler::TransitionType transition_type)
   {
      std::cout << "OnLoadStart:" << (*(*browser).GetMainFrame()).GetURL() << std::endl;
   }



When I create a visual browser and open YouTube.com, the first time OnloadStart is called, but then I click on some video - a new URL with this video opens in the same browser, BUT OnLoadStart is not called at all now.
No matter how much I follow the links to the video, the OnLoadStart is not called.

Thus, I wanted to determine that a new link was clicked, but this does not work for YouTube.

Is this correct behaviour?
Staxcelrom
Expert
 
Posts: 206
Joined: Wed Jan 26, 2022 8:20 am

Re: OnLoadStart - not always called

Postby magreenblatt » Sat May 21, 2022 5:03 am

Depends. Youtube could be loading new content without actually navigating. What does the DevTools Network tab show?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: OnLoadStart - not always called

Postby Staxcelrom » Sat May 21, 2022 5:47 am

If watch the event "Network.requestWillBeSent":

parameter:

documentURL
string
The URL of the document this request is loaded for.


That will be like this:



That is, all the same, the request for a new URL goes, but for some reason OnLoadStart does not see it.
Staxcelrom
Expert
 
Posts: 206
Joined: Wed Jan 26, 2022 8:20 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot], TakashiHSD and 41 guests