4

I have an app with 2 tabs. The container of app is developed in Native code and CEF has been used to open html pages in one of the tabs. When I switch from Tab 1 (Native) to Tab 2(CEF) contents of Tab 1 are visible on Tab 2, though Tab 2 has html page loaded. As I hover mouse over Tab 2 in this situation or do any activity on Tab 2(which has presently content of Tab 1 visible), html content becomes visible. I have checked that I hide/show calls are properly being sent.

As I am not able to find any solution I would like to know if there is some way to refresh the CEF page. I think if I am able to refresh Tab 2 at every switch to Tab 2 it should work fine. Thanks

CaptainBli
  • 4,121
  • 4
  • 39
  • 58
Abhimanyu Vohra
  • 41
  • 1
  • 1
  • 4

4 Answers4

6

In C# you can use this method:

chromeBrowser.Reload(true);

Test on VS 2015

Read more in document: WebBrowserExtensions.Reload Method

Dũng IT
  • 2,751
  • 30
  • 29
3

Not sure what platform/language you are using. The following C++ code will reload the web page.

CefRefPtr<ClientHandler> g_handler;
g_handler->GetBrowser()->Reload();

You could find cefclient project from the official package, It demonstrates various CEF API usage.

Bob Cromwell
  • 445
  • 2
  • 14
1

In VB.NET I use the following code:

Call webBrowser.GetBrowser.Reload()

DataPriest
  • 13
  • 5
0

I've tried this code but it does not worked:

browser.Refresh();

and this code worked for me:

browser.Reload(true);

(I'm using Cefsharp in C# Windows Form)

Elyas Nategh
  • 540
  • 6
  • 5