wxWebView with Chromium backend
wxWebView with Chromium backend
I need to do HTML/Angular development in my wxWidget desktop application (very similar to Electron https://electronjs.org/).
Looks like I should use wxWebViewChromium. I found a project https://github.com/sjlamerton/wxWebViewChromium/wiki that can serve my purpose but as per this project Wiki page, it has support for Windows only. My requirement is to have support for both Windows and MacOS. Could someone focus some light on this project or some other ways?
Looks like I should use wxWebViewChromium. I found a project https://github.com/sjlamerton/wxWebViewChromium/wiki that can serve my purpose but as per this project Wiki page, it has support for Windows only. My requirement is to have support for both Windows and MacOS. Could someone focus some light on this project or some other ways?
Re: wxWebView with Chromium backend
There is an open PR for merging wxWebViewChromium into wxWidgets codebase, see
https://github.com/wxWidgets/wxWidgets/pull/706
That is probably the closest how you can get for now...
https://github.com/wxWidgets/wxWidgets/pull/706
That is probably the closest how you can get for now...
Re: wxWebView with Chromium backend
Hi,
You can actually try to compile it and if it works all around leave a comment for Vadim to merge it.
Thank you.
You can actually try to compile it and if it works all around leave a comment for Vadim to merge it.
Thank you.
Re: wxWebView with Chromium backend
Hey guys,
this seems to be still an open topic. I tried this myself and for many hours now, but I only got confused so far.
To get the code, I eventually created a new local branch to my local wxWidgets project copy via git bash
I compiled that "branch" on windows10 vs2015, which worked out of the box, and then tried to use the modified "webview" example. But this doesn't work:
https://github.com/chromiumembedded/cef-project
and I am providing all the libs asked for (which are already set up in the modified sample, I only needed to adjust the path):
Cheers
Natu
PS:
Instead of having again a custom wxWidgets version for the backend, I would rather have it included into my project, like this outdated approach:
https://github.com/sjlamerton/wxWebViewChromium
But I guess this is even more wishfull thinking?
this seems to be still an open topic. I tried this myself and for many hours now, but I only got confused so far.
That pull request is still open and since I am not very experienced with git(hub) I struggled quite a bit with this.PB wrote: ↑Fri May 25, 2018 7:54 am There is an open PR for merging wxWebViewChromium into wxWidgets codebase, see
https://github.com/wxWidgets/wxWidgets/pull/706
That is probably the closest how you can get for now...
To get the code, I eventually created a new local branch to my local wxWidgets project copy via git bash
Code: Select all
git fetch https://github.com/wxWidgets/wxWidgets pull/706/head:chromium
git checkout chromium
I tried that with the newest master branch of the cef-projectmissing external symbol ""char const * const wxWebViewBackendChromium" (?wxWebViewBackendChromium@@3QBDB)"
https://github.com/chromiumembedded/cef-project
and I am providing all the libs asked for (which are already set up in the modified sample, I only needed to adjust the path):
Could anybody get this up and running? Any tips on how to tackle this?C:\Widgets\lib\vc_lib\wxmsw31u_webviewchromium.lib
C:\Widgets\lib\vc_lib\wxmsw31u_webview.lib
C:\cef-project\third_party\cef\cef_binary_3.3538.1852.gcb937fc_windows32\Release\libcef.lib
C:\cef-project\libcef_dll_wrapper\Release\libcef_dll_wrapper.lib
Cheers
Natu
PS:
Instead of having again a custom wxWidgets version for the backend, I would rather have it included into my project, like this outdated approach:
https://github.com/sjlamerton/wxWebViewChromium
But I guess this is even more wishfull thinking?
Re: wxWebView with Chromium backend
Hi,
You should probably leave a comment on this PR about what you did and what the results are.
Hopefully Steve (Lamerton) is still around to look at it or maybe Tobias will be able to look at this PR (since he just tackled the HTTPS stuff).
Or try to send an e-mail to the wx-users ML and see if Steve is still there...
Thank you.
You should probably leave a comment on this PR about what you did and what the results are.
Hopefully Steve (Lamerton) is still around to look at it or maybe Tobias will be able to look at this PR (since he just tackled the HTTPS stuff).
Or try to send an e-mail to the wx-users ML and see if Steve is still there...
Thank you.
Re: wxWebView with Chromium backend
Just a thought: Did you set wxUSE_WEBVIEW_CHROMIUM to 1 (the default seems to be 0)?
FWIW, I just tested it and could build and run the sample successfully. I used CMake (checked wxUSE_WEBVIEW_CHROMIUM and set wxBUILD_SAMPLES to "ALL") and MSVC 2017, shared release build.
I am not any good with GIT (I use TortoiseGIT), so I just cloned whole TcT2k's wxWidgets fork and switched to the chromium branch.
FWIW, I just tested it and could build and run the sample successfully. I used CMake (checked wxUSE_WEBVIEW_CHROMIUM and set wxBUILD_SAMPLES to "ALL") and MSVC 2017, shared release build.
I am not any good with GIT (I use TortoiseGIT), so I just cloned whole TcT2k's wxWidgets fork and switched to the chromium branch.
Re: wxWebView with Chromium backend
Offtopic: I'm not very good with GIT either, but i recently discovered https://git-fork.com which is very close to Tower (a commercial and probaly the best GIT client). And i think it's great.
Use the source, Luke!
Re: wxWebView with Chromium backend
Thanks for your input
I think I should try cmake building myself. Good to know that you found a way to do it out of the box. It just has so many variables to play with:
cef-version, vs-version, building flags..
Cheers
Natu
I tripped over that, but yes, I finally did set the flag.
Did you use the newest cef-version in your test? ( 3.3282.1735.g1e5b631 )
I think I should try cmake building myself. Good to know that you found a way to do it out of the box. It just has so many variables to play with:
cef-version, vs-version, building flags..
I hope they are. It would be a shame if this project wouldn't make its way into wxWidgets after all this work. And the chromium backend might be the one backend, that survives them all.ONEEYEMAN wrote: ↑Wed Mar 27, 2019 2:59 pm Hi,
You should probably leave a comment on this PR about what you did and what the results are.
Hopefully Steve (Lamerton) is still around to look at it or maybe Tobias will be able to look at this PR (since he just tackled the HTTPS stuff).
Or try to send an e-mail to the wx-users ML and see if Steve is still there...
Thank you.
Cheers
Natu
Re: wxWebView with Chromium backend
No, I did use the one CMake automatically downloads and installs. However, I do not think it has any effect on your linker error with wxWidgets' declared string....
I used CMake (CMake-GUI) because it is the simplest way to build wxWidgets library and samples, and it also has a very user friendly way of customizing all wxWidgets build options.
Re: wxWebView with Chromium backend
I tried to follow your steps, used the cmake GUI and a custom flag "wxUSE_WEBVIEW_CHROMIUM to 1".PB wrote: ↑Thu Mar 28, 2019 8:38 amNo, I did use the one CMake automatically downloads and installs. However, I do not think it has any effect on your linker error with wxWidgets' declared string....
I used CMake (CMake-GUI) because it is the simplest way to build wxWidgets library and samples, and it also has a very user friendly way of customizing all wxWidgets build options.
First I checked Static build because this is what I actually want. It compiled 111 projects, and had errors on 7. The webview sample (chromiumized) was missing its cef libraries. So my cmake approach did not automatically download any cef data. I copied my cef data into "rdparty" according to the paths set for the linker, and there I was again:
"missing extern symbol: ""char const * const wxWebViewBackendChromium" C:\wxWidgets-chromium\samples\webview\webview.obj"
I then tried the Dynamic build (default). It compiled all wxwidgets projects, no errors. The cef libraries were still there, since I copied them before. But making the webview sample dynamic made it complain about static - dynamic missmatch (but why? even cef project is dynamic by default). Trying it static again leads to:
"missing extern symbol: ""char const * const wxWebViewBackendChromium" C:\wxWidgets-chromium\samples\webview\webview.obj"
I guess I need a fresh try with dynamic.
I still don't see my fault in this mess.
@PB: When you build the webview sample, do you only have one webview.cpp and it is ready to build or did you modify the sample in any way? I remember some chromium_cef1 and chromium_cef3 files from github (which I guess should be included into webview).
Thanks for your time.
Natu
Re: wxWebView with Chromium backend
First, try a fresh start with a source tree and build outside the source directory.
I did not do such a step, I just checked the wxUSE_WEBVIEW_CHROMIUM option under wxUSE tree (having checked "Grouped" and "Advanced" checkboxes next to "Search" control in CMake-Gui's GUI). Not sure if there is an actual difference though.
I did no modification to any files at all. I do not remember (I will check when I get to a computer with that build) if the sample source was separate, the executable certainly was.
Re: wxWebView with Chromium backend
Thanks for describing further.
I am almost certain, that I already fail on downloading the right repository. When I get the repo (from github) from TcT2k directly, the solution is not complete and cmake complains about it:
So I add the missing projects from my original wxWidgets github repo, but that can't be the way it's supposed to be... or is it?CMake Error at build/cmake/functions.cmake:448 (add_library):
Cannot find source file:
C:/wxWidgets_Chrome/src/png/png.c
[... and several more]
CMake Error: CMake can not determine linker language for target: wxpng
[... and several more]
As for the static vs. dynamic building, I found the source where I read that I am supposed to use a dynamic build:
http://hokein.github.io/wxWidgets/class ... omium.html
But who knows, if this information is (still) valid. At least I could build wxWidgets (chromiumized) with the dynamic build without errors.
I will now try again from a fresh directory, dynamic build, newest cef build and I keep an eye out for the advanced flags in cmake GUI as you mentioned.
One last thing: You wrote, that RunScript() with the Chromium backend does not return values. Is that according to your knowledge still the case?
Thanks again!
Natu
[EDIT]:
I think last time I copied to much. This time I just got the source from the picture libs, that were missing, and after that cmake could run through without error. It was only after that, that cmake was downloading cef and set a new path variable:
I guess this was the missing piece. Gotta go on compilingCEF_ROOT C:/wxWidgets_Chrome/build/libs/webview_chromium/cef-source
Re: wxWebView with Chromium backend
I did not "wrote it", it is a documented limitation of the back end and to my best knowledge it is still the case. I tried looking into it but it appeared to be difficult to implement, due to Chromium architecture (async, multiple threads/processes). OTOH, it seems to work with MiniBlink, too bad that MiniBlink is not a global audience friendly.
BTW, with Chromium PR, no manual copying whatsoever should be necessary. You just need to switch the branch cleanly and remember that 3rd party libs (such as libpng or libzip) are GIT submodules which need to be initialized.
Re: wxWebView with Chromium backend
You wrote it, assuming you are PBfordev, who commented on that on GitHub.PB wrote: ↑Tue Apr 02, 2019 12:24 pmI did not "wrote it", it is a documented limitation of the back end and to my best knowledge it is still the case. I tried looking into it but it appeared to be difficult to implement, due to Chromium architecture (async, multiple threads/processes). OTOH, it seems to work with MiniBlink, too bad that MiniBlink is not a global audience friendly.
Sry to confuse.
And yes, its a shame. MiniBlink is quite easy to set up, using imRekers API for wxWidgets. But you just can't go with it untouched, as it even has hardcoded chinese signs in popup context menus. I also found, that several modern HTML elements do not show properly in MiniBlink, especially with quite modern approaches like Quasar CLI. The sef sample browsers on the other hand do quite fine. I'd assume that MiniBlink just became a little outdated.
I am not sure if I can follow you. What do you mean by "Chromium PR"?PB wrote: ↑Tue Apr 02, 2019 12:24 pmBTW, with Chromium PR, no manual copying whatsoever should be necessary. You just need to switch the branch cleanly and remember that 3rd party libs (such as libpng or libzip) are GIT submodules which need to be initialized.
It would seem that I did not initialize those submodules then, though my manual copying of the source files did the same thing for me.
[EDIT]: I also couldn't use the git command on my files, because my current test dir is no git dir. I just downloaded the files as zip.
Unfortunately there is still some things going awry. I chose a different path as a build directory and as a result all the standard paths didn't find their compiled sources. I ended up copying my new build directory into the source dir.
Going on from that, the webview_chromium project cant find "wxmsw31u_webviewchromium.lib" and in fact I dont have such a file in my wxWidgets repo (I only have it in the master branch checkout). What I have is a "wxmsw31u_webview_chromium.lib". Is that supposed to be the one?
I still wonder how you could just build the whole thing from the get go.
Re: wxWebView with Chromium backend
Hi,
Because PB just cloned TcT2K repository and switched the branch appropriately.
BTW, I believe the actual WebView code is able to do RunScript() with return value. It just a Chromium that doesn't support it (yet?).
Thank you.
Because PB just cloned TcT2K repository and switched the branch appropriately.
BTW, I believe the actual WebView code is able to do RunScript() with return value. It just a Chromium that doesn't support it (yet?).
Thank you.