CEFsharp load url is holding on to the previously navigated url - c++

We have a C++ application (using Owl UI framework) which calls a CEFsharp Chromiumbrowser control inside an owl dialog. It is working perfectly the first time and the chromium embedded control shows the page properly. It is important to mention here that the first url which is say "http//www.someurl" navigates internally to "http://www.anotherurl/opensomething" each time. When we close the Owl MDI window and then try to open it again, the CEFSharp browser control tries to go straight to "http://www.anotherurl/opensomething" instead of going to "http//www.someurl" which it is being specifically asked to navigate to. We are using Chromiumbrowser load method to load the url but just cannot make it to load the first url from the second time onward. Our CEFsharp version is 63.03 . However if we open the chromium browser control in its own window and not embed it inside the MDI dialog it works perfectly everytime. Can't figure out so far as to why this is not loading the url properly from the second time around. Thanks for any help in advance.

Related

Open a new browser tab without losing focus on current application using C++

I would like to open a new browser tab using C++ on Windows, ideally browser-independent, if that is not possible chrome is good enough.
But there are some restrictions:
The current application can not lose focus, but the browser must switch to the new tab.
The tab must be opened to a specific URL
The tab must be opened from a 3rd party application, so not from inside the browser.
I have tried using system("start <url>") but that causes the application focus to switch to the browser. I could not find a chrome:// URL to open a new tab with an initial URL.
I have also found several threads showing similar things in JavaScript, but none for C++.
Is there a way (ideally safer than using system()) to open a new browser tab without losing focus on the current application, using C++ on windows?
Additional clarification:
3 windows open: One game, the browser and a 3rd party application.
The game is in the foreground, but the 3rd party application opens the browser tab on certain events. Sadly, this means that DLL injection is not an option, due to several anti-cheat restrictions. This also means that a background application needs to open a new browser tab of a browser that is also in the background without ever losing focus on the game.

Active Qt bug when I use a Web Browser

I'm using Active Qt in the goal to show a Web Browser inside my qt application. I can show a Google Map page inside a Tab. It uses an ActiveX-based component with an Internet Explorer Browser inside. Everything is ok but when I resize the windows with my mouse, I have a strange non-wanted resize to my orignal size (800x600) after 1 or 2 secondes of manual resize.
Do you have a tip to avoid this strange behavior ?
ps : I use Qt 5.6.2 cuz I need about the Windows XP¨compatibilty

CEF closing/resizing issues inside a big application plugin

I'm writing a plugin for a big x64 application in C++. I want the plugin to open a dialog and show a web view of my site.
I'm been able to use WKWebView in macOS and it works well. On Windows I'm evaluating CEF https://bitbucket.org/chromiumembedded/cef (please let me know of any alternative, ideally I would like it to be Webkit-based).
Let's say the application framework that is hosting my plugin has already created a window for my plugin and has it's own message loop, so I can only receive events in a sort of WindowProc. I can also get the HWND of the window.
My implementation is inspired by cefsimple example, because cefclient is way too complicated. I've implemented the subprocess architecture with the external executable and everything works fine until it's rendering the client area of the window. Then I have problems with closing the window (it crashes) and resizing the window interactively (the window frame is resized but the web view in the client area does not resize).
I've tried all possible combinations, but I've run out of ideas. Namely:
If I use CefRunMessageLoop() the web view is rendered correctly but the main application does not process the UI events like close window button. Resize does not work.
If I call CefDoMessageLoopWork() myself once in a while (from WindowProc) the web view is rendered correctly and it processes the close button, but it crashes. Resize does not work.
If I use settings.multi_threaded_message_loop = true the web view is rendered correctly and I can close the window without crash. The destructor of the window calls CefShutdown(). But if I try to reopen the window it crashes! Are CefInitialize and CefShutdown allowed to be called only once?
And resizing still does not work. I don't understand why in the cefsimple example resizing works and in my window it does not work.
Besides message processing issues, probably I'm not closing the browser correctly, any advice? Why is so complicated? WKWebView is so straighforward!
There is no error message, no stack trace, no source code, no OS/CEF version - I doubt this question can be answered.
I can only tell you how to close browser cleanly: call CefShutdown at the right time (see cefclient/cefsimple examples) and do not keep any references to CEF objects when calling shutdown.

Get HTML output in a window in c++ using Win32

I am new to C++. I really need to know how to get the output of HTML file in a window instead of getting that in browser. I searched so many sites. I got to know by using Tidy library, will get that but I don't know how to proceed with that.
Can any one please tell me how I will get the HTML output in a window?
I am using WIN32 API.
If I understand what you want, you would like to display HTML.
Internet Explorer as an ActiveX control should work for you, you can host HTML pages within your application. It is a deep subject, but you can get started by looking up information on the interface:
IWebBrowser2
If you are creating a windows application, open your dialog editor and add a reference to the MS Web Browser control, I can't tell you specifically what it is, but it should be in the list of COM controls available

After Navigate2 Method returns S_OK Stuck at READYSTATE of READYSTATE_LOADING

I am working on a MFC Document View architecture application which has multiple documents and views and a tabbed window interface.
I have been tasked with making an automatic switch to another tab on the press of the OK button in one of the other tabs. When the other tab is clicked on it uses a C++ wrapper over IWebBrowser2 to navigate to a specific web page.
When this is done manually by clicking on the tab everything is fine and the webpage within the view loads successfully.
In my first attempt at doing this the tab successfully switched in response to a call to
AfxGetMainWnd()->SendMessageToDescendants(SOME_MESSAGE, ...);
however by sending this windows message at the wrong point the application would crash once control returned because the chain of events caused the (modeless) dialog (*) that
sent the message, to no longer exist.
I then found the correct place to make the call, but now when the other tab is activated, it no longer displays the webpage as it should.
To debug this problem I added code to check the READYSTATE in both the situation where it works and the situation where it does not. When the page fails to load (despite the call to Navigate2 returning S_OK), the READYSTATE just stays at READYSTATE_LOADING.
Unfortunately now I am to many edits away from when I had it partially working.
I have added TRACE statements to the most obvious events such as OnSetFocus, CView::OnActivateView but all traces come out in the same order despite the behaviour being different
* hosted in the view