Webview2 control - Chromium browser for Purebasic (Windows) [Jan 1, 2024]
Re: Webview2 control - Chromium browser for Purebasic (Windows)
Updated the listing above:
added a lot of new features.
But for this it was also necesarry to extend WebView2.pbi.
I addede the additional code alo in the posting above.
added a lot of new features.
But for this it was also necesarry to extend WebView2.pbi.
I addede the additional code alo in the posting above.
Re: Webview2 control - Chromium browser for Purebasic (Windows)
Updated the listing above:
added a lot of new events and procedures.
After the alert appears, open the menu and download one of the demo files.
You will see download events in the Debug window.
added a lot of new events and procedures.
After the alert appears, open the menu and download one of the demo files.
You will see download events in the Debug window.
Re: Webview2 control - Chromium browser for Purebasic (Windows)
Thanks infratec ,
What do I need to bring KidSafafeBrowser up to date , just gdiplus ?
Thanks
What do I need to bring KidSafafeBrowser up to date , just gdiplus ?
Thanks
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: Webview2 control - Chromium browser for Purebasic (Windows)
I have no idea from what you are talking.vmars316 wrote: Mon Dec 12, 2022 5:23 pm What do I need to bring KidSafafeBrowser up to date , just gdiplus ?
I created a WebView2 Gadget as a replacement for the outdated WebGadget().
Inside you can open web pages, but not browsers.
Re: Webview2 control - Chromium browser for Purebasic (Windows)
From the recent activity aboveinfratec wrote: Mon Dec 12, 2022 5:30 pmI have no idea from what you are talking.vmars316 wrote: Mon Dec 12, 2022 5:23 pm What do I need to bring KidSafafeBrowser up to date , just gdiplus ?
I created a WebView2 Gadget as a replacement for the outdated WebGadget().
Inside you can open web pages, but not browsers.
I am thinking that I may need to re-download "Webview2 control - Chromium browser for Purebasic (Windows)"
to keep up-to-date .
Thanks
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: Webview2 control - Chromium browser for Purebasic (Windows)
To run my WebView2Gadget()
You need the original stuff from justin:
https://github.com/omegakode/PBWebview2
You need to add the extensions to webvie2.pbi
And if the original loader creates a warning about unresolved externals, you need also the version which I provided as first listing.
Then place the WebView2gadget.pbi in same folder and copy the required loader dll (x86 or x64) in the same directory.
After this the demo inside WebView2Gadget.pbi should work.
Many work, but I don't want to steal the work of justin, since my work is only an addition to his work.
If the WebView2 runtime is not installed you need also to install it from here:
https://go.microsoft.com/fwlink/p/?LinkId=2124703
But on many Win10 PCs it is already available and on Win11 it is definately installed.
You need the original stuff from justin:
https://github.com/omegakode/PBWebview2
You need to add the extensions to webvie2.pbi
And if the original loader creates a warning about unresolved externals, you need also the version which I provided as first listing.
Then place the WebView2gadget.pbi in same folder and copy the required loader dll (x86 or x64) in the same directory.
After this the demo inside WebView2Gadget.pbi should work.
Many work, but I don't want to steal the work of justin, since my work is only an addition to his work.
If the WebView2 runtime is not installed you need also to install it from here:
https://go.microsoft.com/fwlink/p/?LinkId=2124703
But on many Win10 PCs it is already available and on Win11 it is definately installed.
Re: Webview2 control - Chromium browser for Purebasic (Windo
Is there a native solution?Fred wrote: Mon Sep 14, 2020 8:39 am Finally a new native solution is coming ! Thanks for the wrapper, we will look into it once it gets live.
Re: Webview2 control - Chromium browser for Purebasic (Windows)
Hmm? Sorry I think I misunderstood the comment of Fred; thought the Web Gadget of PB was going to become a Chromium control, "natively". It's a bit cringy to still read in 2022: "The WebGadget uses the Internet Explorer 4.0+ ActiveX object on Windows. ".
Re: Webview2 control - Chromium browser for Purebasic (Windows)
not accurate
WebGadget uses ie and can be configured up to the latest ie11 emulation (i.e full IE11) by setting properly registry
even when WebGadget2() becomes native using native webview2 by microsoft (chromium/edge)
WebGadget() WILL and SHOULD remain, because of very high dependency of active components in a numerous commercial products out there need this
offcourse all new design should focus in html5 but compatibility should be needed for decades...
WebGadget uses ie and can be configured up to the latest ie11 emulation (i.e full IE11) by setting properly registry
Code: Select all
Procedure SetBrowserFeatureControl(rpath.s, dwValue.i)
dwLabel.s = GetFilePart(ProgramFilename())
RegCreateKeyEx_(#HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\"+ rPath.s, 0, #Null, #REG_OPTION_VOLATILE, #KEY_ALL_ACCESS, #Null, @phkResult, @Disposition)
RegSetValueEx_(phkResult, @dwLabel, 0, #REG_DWORD, @dwValue, SizeOf(Long))
EndProcedure
SetBrowserFeatureControl("FEATURE_BROWSER_EMULATION", 11001) ;; enable IE11 rendering
WebGadget() WILL and SHOULD remain, because of very high dependency of active components in a numerous commercial products out there need this
offcourse all new design should focus in html5 but compatibility should be needed for decades...
Christos
Re: Webview2 control - Chromium browser for Purebasic (Windows)
For example, you could use something like this
similar to UseSQLiteDatabase() or
similar to InitScintilla()
Code: Select all
UseWebGadget([WebView2LoaderLibraryName$])
Code: Select all
InitWebGadget([WebView2LoaderLibraryName$])
Hygge
Re: Webview2 control - Chromium browser for Purebasic (Windows)
Wow!plouf wrote: Thu Dec 15, 2022 6:25 pm not accurate
WebGadget uses ie and can be configured up to the latest ie11 emulation (i.e full IE11) by setting properly registry...


Re: Webview2 control - Chromium browser for Purebasic (Windows)
First I want to thank Justin and infratec for the great work !
@infratec: there seem to be a strange bug in the WebView2 gadget replacement.
Calling WebView2SetGadgetText results in an IMA
To reproduce, please modify the sample code
IMA occurs in
Do you have any idea ? Tested with X86 code
@infratec: there seem to be a strange bug in the WebView2 gadget replacement.
Calling WebView2SetGadgetText results in an IMA
To reproduce, please modify the sample code
Code: Select all
OpenWindow(0, 0, 0, 1230, 820, "WebView2 Gadget", #PB_Window_ScreenCentered|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget)
WebView2Gadget(1, 10, 10, 600, 800, "https://www.purebasic.fr/english")
WebView2Gadget(2, 620, 10, 600, 800, "https://www.purebasic.fr/german")
WebView2SetGadgetText(1,"https://www.purebasic.fr/english"); <--- adding this line leads to an IMA
Code: Select all
Procedure WebView2SetgadgetText(Gadget.i, URL$)
[..]
*Gadget\wvCore\Navigate(URL$) ; <------ here the IMA occurs
[..]
EndProcedure
Re: Webview2 control - Chromium browser for Purebasic (Windows)
The problem is ... you are to fast.
The WebView2 from MS takes a bit time to load and initialize.
This is done in a thread.
You can see this, because the error comes before you can see:
But then you still have to wait for that flag.
Or I secure it, but then your command is not executed and I return a #False.
I test now how long it blocks if I wait until the WebView2Gadget() is completely working.
The WebView2 from MS takes a bit time to load and initialize.
This is done in a thread.
You can see this, because the error comes before you can see:
I can implement a flag which is set when everything is finished.Debug "Webview2Controller_Created"
But then you still have to wait for that flag.
Or I secure it, but then your command is not executed and I return a #False.
I test now how long it blocks if I wait until the WebView2Gadget() is completely working.
Re: Webview2 control - Chromium browser for Purebasic (Windows)
I can only fix it if I add this add the end of the WebView2Gadget():
InitDone is set to #True at the end of Webview2Controller_Created()
But I don't want to do this, because I maybe loose some Events.
Code: Select all
Repeat
WindowEvent()
Delay(10)
Until WebView2GadgetMap()\InitDone
But I don't want to do this, because I maybe loose some Events.