Page 9 of 13

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

Posted: Wed Jan 11, 2023 6:41 pm
by Oliver13
The problem is ... you are to fast.
The WebView2 from MS takes a bit time to load and initialize.
Thank you for your fast response, I just assumed such a reason.

Or I secure it, but then your command is not executed and I return a #False.
Yes, I think to return #true in case of succes would be a bullet proof approach.

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

Posted: Thu Jan 12, 2023 12:16 pm
by zikitrake
Does anyone know why I keep getting the following error?
Image

I have tried to:

- Uninstall/install the webview2 library with the same result.
- Delete the entire webview2 folder and re-download the sources from github.

System info:

PB 6.00 LTS x64

Image

Thank you in advance!

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

Posted: Tue Mar 07, 2023 11:10 pm
by vmars316
TIA ,
I have been away from this project (KidsafeBrowser) for a while ,
but now I am able to work on it again .
My coding works as expected EXCEPT for youtube.com .
Once on the site (at an approved link)
youtube has a way of by-passing SafeBrowser's safety-check for 'Approved Links Files .

I am doing this safety-check here "Procedure core_NavigationStaring" .

Is there a Navigation Event where I check for
1) a search
2) clicking on a youtube link to another youtube page ?

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

Posted: Tue Jun 20, 2023 4:00 pm
by dartaud
Hi,

Does anyone know how to get the URL that webview2 is currently using? LIke if user navigates to a new page? I have read forum posts here, looked at the code and tried to understand but for some reason not getting it. Thinking I am missing something, have some kind of brain block because I can't figure out how to get the URL that the webview2 control is currently using if the user clicks a link and goes to a new URL. Thanks for any help

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

Posted: Tue Jun 20, 2023 10:05 pm
by Justin
Hi, it´s been some time since i haven't looked at the code but you can use the get_Source() method of the ICoreWebView2 interface or handle the NavigationStarting event and use get_uri() on its args, and example of this is in the basic_browser_async.pb example.

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

Posted: Thu Jun 22, 2023 4:27 am
by dartaud
Thanks Justin, I see now that NavigationStarting works for this.

Another question, maybe someone knows.. I noticed that the basic_browser_async.pb example supports ctrl+f in the browser window so the user can use the browser find function on the current page. I also noticed that Infratec's version of webview2 which turns it into a webgadget (which is useful) does not seem to support the ctrl+f function. Wondering if anyone knows why and how to fix this in the webgadget version of webview2 control.

again, thanks for any help

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

Posted: Thu Jul 20, 2023 12:23 pm
by infratec
I run into a problem with my WebView2Gadget():
In one application the content was not shown.

After digging into this problem I found a missing thing: tell the WebView2 the handle of the output 'window'.
After implemented this, it worked as it should.

I provide now a download for the complete stuff, since Justin did not implement my changes:

PBWebView2 & WebView2Gadget

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

Posted: Fri Aug 18, 2023 12:33 pm
by HanPBF
Hello,

I tried WebView2 in PureBasic and got an error in running the source with C backend compiler.

I use 6.03 beta 4 LTS (x64) on Windows 10 x64.

Compiling with both compilers work:
PureBasic 6.03 beta 4 LTS (Windows - x64)
PureBasic 6.03 beta 3 LTS - C Backend (Windows - x64)

When running the source with C backend I get the folloing error with no debugger code line:
error: expected expression before '.' token
9919 | .cSize equ 2
| ^
purebasic.c:9936:26: error: unknown type name 'get'
9936 | movzx eax, byte [r8] ; get type
|
purebasic.c:9937:1:error: expected '=', ',', ';',
beta and problem known or anything else?
source by infratec needed?

Thanks in advance, regards!

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

Posted: Fri Aug 18, 2023 6:41 pm
by infratec
The problem is VCall.pb

But it's not from me, it's from Wilbert.
It needs a conversion to C assembler.

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

Posted: Sat Aug 19, 2023 6:05 pm
by Justin
Hi, i updated the code to work with the c backend, it uses libffi, it's based on some code i found from Wilbert, the code is in examples\host_object.pb
So for ASM Backend uses VCall, for C Backend libffi.
The included libffi-6.dll it's needed, i could not compile it, i already had it, if someone could show how to compile from sources a dll or better a static lib would be great.
I tried this method but failed:
https://proj.goldencode.com/projects/p2 ... on_Windows

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

Posted: Sat Aug 19, 2023 10:32 pm
by Boulcat
Hi Justin,
Thanks for the update, I've tried the examples and everything works fine with the C backend (Windows x64)
But with the C backend (Windows x86), I get with PB 6.01 or 6.03 beta5:

Code: Select all

error: Unresolved external symbol
 '_GetAvailableCoreWebView2BrowserVersionString@8'.
POLINK: error: Unresolved external symbol 
'_CreateCoreWebView2EnvironmentWithOptions@16'.
POLINK: fatal error: 2 unresolved external(s).

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

Posted: Sun Aug 20, 2023 7:24 pm
by Justin
It seems that import does not work in x86, changed to use proptotypes.
It should work now.
The examples use by default the x64 dlls for, x86 replace them with the ones in the x86 dir

Still no luck trying to compile libffi, after running the configure script says compiler can't create executables

https://github.com/libffi/libffi

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

Posted: Mon Aug 21, 2023 12:09 am
by Boulcat
Thanks, it now works with both x64 and x86 C Backend 8)

I tried to compile libffi by following the procedure: Building and Installing libffi on Windows
Download: https://proj.goldencode.com/downloads/m ... 140425.zip
Extract mingw64 folder to C:\mingw64
Include C:\mingw64\bin to the path: cmd as Admin > Setx /M PATH "%PATH%;C:\mingw64"

Download: https://proj.goldencode.com/downloads/m ... 111123.zip
Extract MSYS32_20111123\msys folder to C:\msys

Download: https://proj.goldencode.com/downloads/l ... ources.zip.
Extract libffi-3.2.1 folder to C:\libffi-3.2.1

Execute C:\msys\msys.bat, it opens a MINGW32:~ console
Change current directory: cd c:\libffi-3.2.1
Prepare x86 target build config: sh ./configure
Prepare x64 target build config: sh ./configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32
Build: make
But I had no success with libffi v3.4.4 releases: it lacks some files: configure, install-sh, Makefile.in,... (don't know how they are built!)

I found a complete libffi v3.4.4 source package, with the missing files included, in the powerful ImageMagick, here : https://github.com/ImageMagick/ffi
With a successful build :)

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

Posted: Mon Aug 21, 2023 11:28 am
by Justin
Finally i could compile libffi statically for x86 and x64. For asm backend it also needs libgcc.a.
Everything is included in the last release.
It does not use VCall anymore but i have left the code and the include.

So now it should work with any system and backend without VCall.

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

Posted: Thu Oct 05, 2023 8:15 am
by infratec
Added the possibility to use a proxy with my WebView2Gadget()
Added an event which tells you that the Gadget is completely available (needs some time to start the whole stuff)
Added the possibility to open the development console.