The iframe across origins cannot to receive process message.

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.

The iframe across origins cannot to receive process message.

Postby blackknife » Mon Feb 01, 2021 4:15 am

The main process code:
Code: Select all
bool OnProcessMessageReceived(
   CefRefPtr<CefBrowser> browser,
   CefRefPtr<CefFrame> frame,
   CefProcessId source_process,
   CefRefPtr<CefProcessMessage> message)
{
    //The renderer process will execute "frame->SendProcessMessage(PID_BROWSER, CefProcessMessage::Create("Test"));" at appropriate position.
    frame->SendProcessMessage(PID_RENDERER, CefProcessMessage::Create(L"Test"));
    return true;
}


The renderer process code:
Code: Select all
bool OnProcessMessageReceived(
   CefRefPtr<CefBrowser> browser,
   CefRefPtr<CefFrame> frame,
   CefProcessId source_process,
   CefRefPtr<CefProcessMessage> message)
{
    printf("Test\n");
    return true;
}


It cannot to receive process message and print "Test" on render process.
blackknife
Techie
 
Posts: 30
Joined: Sun Apr 14, 2019 11:53 pm

Re: The iframe across origins cannot to receive process mess

Postby amaitland » Mon Feb 01, 2021 5:16 am

Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

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