Where can I get a callback when I click the "custom scheme"?

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.

Where can I get a callback when I click the "custom scheme"?

Postby hellWorld91 » Fri Sep 03, 2021 12:21 am

After running the cef web browser, is there a callback function where I can receive information of "custom system url" when I click the button?
hellWorld91
Newbie
 
Posts: 7
Joined: Fri Sep 03, 2021 12:11 am

Re: Where can I get a callback when I click the "custom sche

Postby magreenblatt » Fri Sep 03, 2021 10:12 am

magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Where can I get a callback when I click the "custom sche

Postby hellWorld91 » Sun Sep 05, 2021 8:51 pm

Thank you for your answer.
We are implementing it by referring to the link.
Is the CefSchemeHandlerFactory mandatory?
hellWorld91
Newbie
 
Posts: 7
Joined: Fri Sep 03, 2021 12:11 am

Re: Where can I get a callback when I click the "custom sche

Postby magreenblatt » Mon Sep 06, 2021 2:24 am

You can use GetResourceHandler instead.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Where can I get a callback when I click the "custom sche

Postby hellWorld91 » Mon Sep 06, 2021 3:20 am

I'm sorry. I don't understand.
The procedure I just implemented...
CefApps are inherited and implemented.
You have registered with OnRegisterCustomSchemes.
What do I need to implement to get a callback?
hellWorld91
Newbie
 
Posts: 7
Joined: Fri Sep 03, 2021 12:11 am

Re: Where can I get a callback when I click the "custom sche

Postby magreenblatt » Mon Sep 06, 2021 4:53 am

You need to implement CefClient::GetRequestHandler, CefRequestHandler::GetResourceRequestHandler, CefResourceRequestHandler::OnBeforeResourceLoad. Pass the CefClient instance to CreateBrowser. See also https://bitbucket.org/chromiumembedded/ ... e_handler/ for an alternative approach.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Where can I get a callback when I click the "custom sche

Postby hellWorld91 » Mon Sep 06, 2021 7:01 am

Thanks for your help.
I have a question, but other than CefResourceManager,
Is there a way to get the correct CefResourceHandler?
hellWorld91
Newbie
 
Posts: 7
Joined: Fri Sep 03, 2021 12:11 am

Re: Where can I get a callback when I click the "custom sche

Postby magreenblatt » Mon Sep 06, 2021 10:49 am

I don’t understand your question.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Where can I get a callback when I click the "custom sche

Postby hellWorld91 » Mon Sep 06, 2021 10:42 pm

Thanks to this, the callback function implementation was successful.

When you press the button,
You are about to add a logic to call back to My Project (AS3).

OnBeforeResourceLoad or GetResourceRequestHandler
Which of the two would be a good implemented?

You also registered scheme_name in the "AddCustomScheme" function. Is there a way to get scheme_name?

Please give me some advice.
Thank you always.
hellWorld91
Newbie
 
Posts: 7
Joined: Fri Sep 03, 2021 12:11 am


Return to Support Forum

Who is online

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