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

Everything else that doesn't fall into one of the other PB categories.
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by infratec »

Fixed a bug when #PB_Any was used for the WebView2Gadget()

PBWebView2 & WebView2Gadget
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by Kiffi »

infratec wrote: Thu Oct 19, 2023 9:56 pm Fixed a bug when #PB_Any was used for the WebView2Gadget()

PBWebView2 & WebView2Gadget
thanks for providing the new package! However, the Examples folder does not seem to be included(?)
Hygge
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by infratec »

I only provided the WebView2Gadget() as replacement for the PB WebGadget().
So I reduced the zip file to the minimum which is required to run and show the WebView2Gadget().

Inside of the WebView2Gadget.pbi is an example. If you load this file and run it, it will show 2 Gadgets and different possibilities to handle them.
User avatar
Kiffi
Addict
Addict
Posts: 1484
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by Kiffi »

infratec wrote: Fri Oct 20, 2023 4:27 pmInside of the WebView2Gadget.pbi is an example. If you load this file and run it, it will show 2 Gadgets and different possibilities to handle them.
thanks for the hint!
Hygge
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by BarryG »

infratec wrote: Fri Oct 20, 2023 4:27 pmInside of the WebView2Gadget.pbi is an example. If you load this file and run it
You get this:

Code: Select all

---------------------------
Error
---------------------------
WebView2 DLL not loaded
---------------------------
OK   
---------------------------
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by infratec »

Is WebView2 runtime installed?
In Win 10 this should be the cas if your PC is up to date.
But check it in the software control paneL
It is called: Microsoft Edge WebView2 runtime

If not, you have to install it.

Oh, and if you use PB x64 you have to copy the WebView2Loader.dll from the x64 subdirectory.
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by BarryG »

Oh, okay. I thought I could unzip the folder and just run that puppy. Never mind, then.
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by infratec »

If you use PB x86, that's the case. :wink:
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by BarryG »

I see. Nah, I only use 64-bit these days.
vmars316
Enthusiast
Enthusiast
Posts: 474
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by vmars316 »

Tia ,
I downloaded the latest https://github.com/omegakode/PBWebview2 .
But when I compile Ohm.pb (PBWebview2-master\examples\Ohm Browser) ,
I get the following Error:
Line 258: Structure not found: ffi_cif ,
in PB_Host_Object.pb , line 258 =

Code: Select all

Protected.ffi_cif cif
.
Pls , what can I do to get past this ?
Thanks for your help...
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by infratec »

You have to include ffi.pbi
vmars316
Enthusiast
Enthusiast
Posts: 474
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by vmars316 »

Ah Perfect ,
Thank you infratec...
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
vmars316
Enthusiast
Enthusiast
Posts: 474
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by vmars316 »

Tia :
I notice a difference in behavior between how
Chrome and MsEdge handles youtube.com vs how
Ohm handles 'clicking' on an 'on page link' .

With Chrome and MsEdge , clicking on a link
results in a change to the 'address bar' ,
showing the updated/requested URL of the 'clicked on link' .

WIth Ohm , it doesn't show the updated URL of the 'clicked on link' .
With my changes to Ohm , I need to check this requested link against a file of 'safe links' to determine if it is a 'safe link' .

I checked Ohm against youtube alternatives , and they all update the 'address bar' .

youtube is doing something to keep user on their site .

Is there a way to catch a 'requested link' for youtube.com .

Actually it might be better to capture
clicking on an 'on page link' (for any page) and
then check if it is a 'safe site' and
don't even start Navigaton if site is unsafe .
I know how to do that in javascript , but how can I do that in PB ?

Thanks for your help...
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by infratec »

You can look at the NavigationCallback().
Justin
Addict
Addict
Posts: 948
Joined: Sat Apr 26, 2003 2:49 pm

Re: Webview2 control - Chromium browser for Purebasic (Windows)

Post by Justin »

Doesn't the NavigationStarting event do what you want?
https://learn.microsoft.com/en-us/micro ... navigating
Post Reply