hi everyone
I have 2 html page and I need to pass value of first html page to second html page then how I will get the context of each window?
rahul wrote:So my question is how can I get the context of second html page so that I can get frames from first html page and send it to second html page?
const int64 frame_id =frame->GetIdentifier(); // getting frame id of second html page in OnContextCreated() method
CefRefPtr<CefBrowser> contextRef1;
string st = value; //value from first html page
CefRefPtr<CefFrame> frame = contextRef1->GetFrame(frame_id );
CefRefPtr<CefV8Context> context = frame->GetV8Context();
CefRefPtr<CefV8Context> contextRef2 = context->GetCurrentContext();
CefRefPtr<CefV8Value> object1 = contextRef2->GetGlobal();
str = CefV8Value::CreateString(value);
object1->SetValue("myval", str, V8_PROPERTY_ATTRIBUTE_NONE);
CefRefPtr<CefCommandLine> command_line =
CefCommandLine::GetGlobalCommandLine();
url = command_line->GetSwitchValue("url");
if (url.empty())
{
url = "file:///C:/Users/Rahul Ranjan/Desktop/videoStream.html";
url1 = "file:///C:/Users/Rahul Ranjan/Desktop/videoStream1.html";
}
// Create the first browser window.
CefBrowserHost::CreateBrowser(window_info, handler.get(), url,
browser_settings, NULL);
// Create the Second browser window.
CefBrowserHost::CreateBrowser(window_info, handler.get(), url1,
browser_settings, NULL);
Users browsing this forum: No registered users and 25 guests