First I tried this below, but the "about:blank" seems to get queued after OnAfterCreate returns.
- Code: Select all
Creating the browser:
CefBrowserHost::CreateBrowser(info, handler.get(), "about:blank", settings);
OnAfterCreate:
browser->GetMainFrame()->LoadString("<html><body>Hello World!</body></html>", "http://www.google.com");
Having read this thread, I also tried this below, but it simply loaded the about:blank page and immediately loaded Google afterwards.
- Code: Select all
Creating the browser:
CefBrowserHost::CreateBrowser(info, handler.get(), "", settings);
OnAfterCreate:
browser->GetMainFrame()->LoadURL("about:blank");
browser->GetMainFrame()->LoadString("<html><body>Hello World!</body></html>", "http://www.google.com");
Do I need to be creating a resource handler as well to intercept this? If so, then how does LoadString() make things simpler than LoadURL() if I need a resource handler anyway?
This is CEF 3.1180.823 with the Windows binaries.
Thanks.