Webview2 control - Chromium browser for Purebasic (Windows) [Jan 1, 2024]

Everything else that doesn't fall into one of the other PB categories.
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by ChrisR »

You rock Justin and Ohm version 0.1 is superb Image
Fred wrote:Finally a new native solution is coming ! Thanks for the wrapper, we will look into it once it gets live.
Image Image
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Hi ChrisR, thanks i want to keep improving it.
Fred wrote:Finally a new native solution is coming ! Thanks for the wrapper, we will look into it once it gets live.
That's great, will be chromium in the three platforms? or webkit in linux /mac?

One thing i found problematic is that ExecuteScript() is asynchronous, in c# you can use async/await but in PB i had to spawn a message loop to make a synchronous version. I hope you found a better solution, don't known if implementing async / await is possible in PB.
HanPBF
Enthusiast
Enthusiast
Posts: 562
Joined: Fri Feb 19, 2010 3:42 am

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by HanPBF »

Hello Justin: great!great!great!

Even ctrl-shift-i does open development tools!

(Any idea how to bind an external chrome developer via remote debugging? chrome://inspect)


Your implementation is a game changer!

Again: great!
Thanks a lot!!!
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Hi HanPBF,
i don't have experience with remote debugging, but it is expained here:
https://docs.microsoft.com/en-us/micros ... debugging/

I tried the Android device debugging and it worked as expected, it did not recognize my android phone at first, i had to follow the steps here: (The Update 24 February 2016 part)
https://stackoverflow.com/questions/219 ... plugged-in

Basically i installed the Windows USB driver, the ADB package, and issued 'adb devices' from cmd as explained in the page and it worked.

Is that what you were looking for?
HanPBF
Enthusiast
Enthusiast
Posts: 562
Joined: Fri Feb 19, 2010 3:42 am

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by HanPBF »

Yes, normally a page shown with a specific port should be enough to remote debug.

But, internal debugger (ctrl-shift-i) should always work.

Thanks!
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Small update 4 October 2020, see first post.
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Seymour Clufley »

Thanks for this, Justin. Excellent work.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Updated to 1.0.622.22 SDK, see first post.
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Updated to 1.0.674-prerelease SDK, see first post.

The prerelease has introduced static linking of the WebView2Loader.dll, it does not work simply importing it in PB because you have to import all the dependencies.

If anyone wants to try, WebView2LoaderStatic.lib it's in the prerelease folder:

Try:

Code: Select all

Import "WebView2LoaderStatic.lib"
	CreateCoreWebView2Environment(environment_created_handler.i)
	CreateCoreWebView2EnvironmentWithOptions(browserExecutableFolder.s, userDataFolder.s, environmentOptions.i, environment_created_handler.i)
	GetAvailableCoreWebView2BrowserVersionString(browserExecutableFolder.s, versionInfo.i)
	CompareBrowserVersions(version1.s, version2.s, result.i)
EndImport

CreateCoreWebView2Environment(0)
And it will show all the unresolved external symbols, maybe someone can fix it.
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Updtated to the latest WebView2 SDK 1.0.664.37 / 1.0.721-prerelease.
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Tenaja »

Thanks for sharing. I think I might use this some day.
firace
Addict
Addict
Posts: 899
Joined: Wed Nov 09, 2011 8:58 am

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by firace »

Great work, thanks for sharing!
User avatar
cabaptista
User
User
Posts: 86
Joined: Sun Nov 30, 2003 11:42 pm
Location: Lisboa, Portugal

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by cabaptista »

Thank you for the great job. :D
oyster
User
User
Posts: 13
Joined: Wed Mar 11, 2020 5:07 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by oyster »

sounds nice.
one question, how to release the final EXE file to end-users to ensure he can see the webview2 control?
Justin
Addict
Addict
Posts: 829
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windo

Post by Justin »

Hi, thanks for the feedback.

I updated to the latest WebView2 SDK 1.0.705.50 / 1.0.781-prerelease, see first post. There are some interesting new apis in the prerelease.

oyster,
Basically you need the WebView2 Runtime installed in the machine and the WebView2Loader.dll from the WebView2 SDK in the executable folder.

The distribution model is explained here:
https://docs.microsoft.com/en-us/micros ... stribution

WebView2 Runtime download:
https://developer.microsoft.com/en-us/m ... /webview2/
Post Reply