|
-
Sep 7th, 2023, 04:28 PM
#441
Re: VB6 WebView2-Binding (Edge-Chromium)
At the end I did it with a WinHttpRequest object that I already know how to handle and it worked.
Thanks a lot!
-
Oct 7th, 2023, 10:28 PM
#442
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Hi Olaf,
Many thanks for developing this.
The current WebResourceResponseReceived event only provides
ReqURI, ReqMethod, RespStatus, RespReasonPhrase, RespHeaders
Could you please implement a way of retrieving the response body (and, preferably, request headers & request body as well)?
-
Oct 7th, 2023, 10:30 PM
#443
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
-
Oct 23rd, 2023, 04:10 PM
#444
Fanatic Member
Re: VB6 WebView2-Binding (Edge-Chromium)

On a customer's computer I see this message when he / I click the microphone button in web.whatsapp.com.
However, when he / I click on it, the result is not saved.
It's not possible to record audio.
Also,
Private Sub WV_PermissionRequested
is not fired.
What could I be missing?
The problem does not occur on my or (so far) any other customer computer.
-
Oct 25th, 2023, 10:10 AM
#445
Fanatic Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Olaf, could you offer a service that assures us "companies" to get support and a maintained product or the source code so that we could continue support it ourselves in case something happens to you?
Last edited by tmighty2; Oct 25th, 2023 at 10:20 AM.
-
Oct 25th, 2023, 10:42 AM
#446
Re: VB6 WebView2-Binding (Edge-Chromium)
WebView2 is not a product by Olaf, he just delivers a more easy programming interface using his vbRichClient 6 environment.
https://github.com/MicrosoftEdge/WebView2Browser
https://learn.microsoft.com/en-us/mi...edge/webview2/
-
Oct 25th, 2023, 11:03 AM
#447
Fanatic Member
Re: VB6 WebView2-Binding (Edge-Chromium)
That is exactely what I am talking about.
-
Oct 25th, 2023, 12:28 PM
#448
Re: VB6 WebView2-Binding (Edge-Chromium)
Outside this forum and a few other die-hard hobbyists it's pretty hard to still find a demand for VB6 apps, maybe that's why Olaf isn't selling his RC6 components.
Looking at Arnoutdv's links I can see that this WebView2 stuff is pretty massive, so even if Olaf shared the source code I think most users would find it rather complicated to fix things themselves but at least it would open the gates for other experts to chime in and help out.
I am wondering whether Olaf implemented WebView2 in VB6 or maybe it's all C++ in the RC6 DLL?
-
Oct 25th, 2023, 03:24 PM
#449
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by tmighty2
Private Sub WV_PermissionRequested
is not fired.
...
The problem does not occur on my or (so far) any other customer computer.
The problem also does not occur on my machine.
Keep in mind, that "permission for accessing built-in hardware" (microphone, camera, GPS, etc.)
has to take "more than one hurdle" (the "Privacy-related, BrowserCtl-internal permissions are only one side of the coin).
There's also the "over-ruling" access-permission for such hardware on the outside (at OS-level).
The OS allows, to define such permissions "App-specific" (for all installed "Store-Apps") -
but also for either "all Desktop-Apps generally", or for "specific Process-Names of Desktop-Apps".
(in a kind of WhiteList - probably stored in the registry somewhere).
Remember, that your own "WebView2-using App" (your Executable) does not run under the flag of "MS-Edge" or something.
(somehow inheriting the permissions of the MS-Browser-Executable)...
No, it is an Executable in its own right (which by default is probably not in the "known list of white-listed Apps").
So, try to find a way, to enable Microphone-usage at that outer level first for your App
(e.g. in a Screen-Session, together with your one problem-customer).
Some systems are quite "closed-off" due to over-eager Company-Domain-Admins -
but that's not a problem the RC6-WebView2-Wrapper can solve...
Olaf
-
Oct 25th, 2023, 03:33 PM
#450
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by VanGoghGaming
I am wondering whether Olaf implemented WebView2 in VB6 or maybe it's all C++ in the RC6 DLL?
All wrapper-classes the RC6.dll exposes, are VB6-implemented, since it's a normal VB6-AX-Dll-Project.
(and that includes cWebView2).
cWebView2 itself interacts with WebView2Loader.dll (which is part of the RC6.dll's "flat-Dll-dependencies") -
and works through this relatively thin MS-provided layer, to talk (via COM-interfaces) -
with the "Evergreen-WebView2-runtime" (about 300-500MB), which MS itself is updating regularly, once installed
(on Win11, that "self-updating, chromium-based BrowserCtl-runtime" comes preinstalled on the system).
Olaf
-
Oct 25th, 2023, 07:16 PM
#451
Re: VB6 WebView2-Binding (Edge-Chromium)
dim web1 as cWebView2
dim ptr1 as long-web1.webcontrolobjptr
dim obj as object
set obj=web1,WebView2control
Can this object be made public? It is convenient for people in need to do more operations.
-
Oct 26th, 2023, 06:22 AM
#452
Fanatic Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Hi Olaf,
can you release the source code of your components so that we can find a way to go on in case something happens to you?
-
Oct 27th, 2023, 11:18 PM
#453
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by tmighty2
...can you release the source code of your components so that we can find a way to go on in case something happens to you?
I'd say - let's talk about that, after "something happened to me"... 
Besides, there's closed-source COMponents in (heavy) daily use in this community,
which date nearly 20 years back with their "last compile-date" as e.g. the unmaintained:
- MS-Winsock.ocx
- MS-FlexGrid, -HFlexGrid
- MS-CommonControls
- MS-ADODC
And nobody demands from MS, that they open their sources for these controls.
Instead those just work (and work and work) - because they are hardened -
and for the few bugs they might still contain, there's "known workarounds".
If you are that concerned, that a closed-source-component will not work anymore "next week" (as it was, at the last compile-date),
then simply "choose another component" (as e.g. the .NET-wrapper for WebView2) -
it really is that easy - and up to you to decide.
I've mentioned the "conditions" for opening the RC6-sources already several times here in this forum...
(the main-condition being: "a base for long-term-survival" - aka an OpenSourced, platform-independent compiler, which we do not have currently).
Olaf
-
Oct 29th, 2023, 11:39 AM
#454
Fanatic Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Olaf,
there is currently no replacement for VB6 for some developers.
I am not releasing any .NET applications to the public because it means giving away your source code.
I know 2 others who run big businesses using VB6 for the same reasons.
I did convert my apps to .NET and decided against releasing them.
People depend on my business.
My softwares are certified and auditioned regularly as they are used in a medical branch.
If you really mean it (regarding "after I am gone"), then can you implement a system that would make the source code accessible to me (and possibly others whose business depend on it)?
-
Oct 29th, 2023, 03:27 PM
#455
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by tmighty2
I am not releasing any .NET applications to the public because it means giving away your source code.
I hope, you notice the irony here...? 
Besides, you can wrap up (only) the .NET WebView2-functionality in a VB6+COM consumable .NET-assembly
quite easily... no need to rewrite "your whole App in .NET" (please read about .NET<->COM-interop).
 Originally Posted by tmighty2
If you really mean it (regarding "after I am gone"), then can you implement a system that would make the source code accessible to me (and possibly others whose business depend on it)?
There are already "measures in place" (which I tried to convey with my little "joke", which would otherwise be somewhat rude).
Olaf
-
Nov 12th, 2023, 09:37 AM
#456
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
VB6.0,WebView2,Please advise on how to copy the PNG format webpage verification code into the picture box, boss.
The website is as follows: http://xxpt.scxfks.com/study/captcha
-
Nov 12th, 2023, 12:42 PM
#457
Re: VB6 WebView2-Binding (Edge-Chromium)
A friend of mine in China has a long life span in his family, and many people spend more than 115 years.
On average, half of them live to be over 100 years old.
He packaged some of the source code into a CD and sold it to many people for a $50 tutorial fee.
In fact, many technologies on our forum are many times more valuable than that.
He is more than 70 years old this year, is a Taiwanese, and has not a single white hair.
This really has a lot to do with heredity. And everyone's way of life.
I wish everyone in here study vb6,vba,vb.net is happy, and everyone is happy to communicate.
After net was abandoned by Microsoft, the number of VB programmers has been decreasing.
In the past 10 years or so, we have probably contributed the most technology and the most powerful technology.
Last edited by xiaoyao; Nov 12th, 2023 at 01:00 PM.
-
Nov 12th, 2023, 12:53 PM
#458
Re: VB6 WebView2-Binding (Edge-Chromium)
@Schmidt You have contributed a lot of VB6 technology. Rc6, DLL. Is undoubtedly a very great product, if many people can learn to use it. It's really convenient, and it can also add a lot of functions to your software. A lot of development costs are reduced.
It was supposed to be a paid software product for you to use for free, and we are very grateful to you.
I was recently working on a mini version of the MySQL server, which was compressed to just over 2.8 megabytes.For the full version, it will be more than 50 megabytes normally.
Mysqld. Exe, just start the process.
And then set the super initial password. I studied it for two whole days. In fact, the cost is also very high. It can be interpreted as $500.
There is one from 2003 or so. LIBMysql. DLL, less than 1000kb, it can connect to the MySQL server.It's been 20 years and it's still working. It's incredible.
It's a little off topic.It's just that the research cost of some technologies is actually very high.You can choose open source or partial open source. It's all free.
Many small functions are implemented with difficult technology and patented technology.
We should respect the technology of original developers and give more encouragement.
-
Nov 12th, 2023, 01:07 PM
#459
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by tmighty2
Olaf, could you offer a service that assures us "companies" to get support and a maintained product or the source code so that we could continue support it ourselves in case something happens to you?
To provide additional services, it must be a VIP who needs to pay extra. You can provide some give some source code or none.
You can't unconditionally ask others to provide you with source code or provide you with more services.
I've asked about this in Microsoft's MSDN support community, as well as in its open source project webviewload. DLL.
It took two years to get back to me that they didn't have any plans to develop VB6 demo code.Although they can adopt or enhance functionality for some bugs or other technical issues.
But they can also refuse 100% or never respond to your needs.
Uch as continuing to offer vb7, VB. Net upgrading
Or provide webview 2.ocx
-
Dec 10th, 2023, 12:19 PM
#460
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Hello Olaf,
I am working on a medical management software in France. For security reasons, reading social security cards and physician identification cards from a browser will soon no longer be possible through scripts within the web page, but through approved extensions added to the browser. Until now, I have been using cWebView2 to authenticate myself with these cards, but this will probably no longer be possible in the future.
Apparently, WebView2 can now handle extensions.
Is there a planned update of RC6 that will bring extension management to cWebView2? (Properties AreBrowserExtensionsEnabled, etc…)
Please keep me informed.
Best regards.
François
-
Dec 10th, 2023, 04:30 PM
#461
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by saturnian
Apparently, WebView2 can now handle extensions.
...
Ah well, ...finally.
Will see what I can do in this regard over the holidays...
Though, assuming you are aware of the AddObject-functionality (using WebView2 as a UI) -
can't you just implement such "extended-stuff" in VB6-Classes and call it from the WebView?
Olaf
-
Dec 11th, 2023, 11:06 AM
#462
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Thank you for your response, Olaf.
I must admit that I am not familiar with the AddObject functionality!
I will try to find examples in the posts of this thread while waiting for integration into cWebView2.
Unless you have a small example?
Best regards, François
-
Dec 11th, 2023, 12:02 PM
#463
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by saturnian
I must admit that I am not familiar with the AddObject functionality!
Unless you have a small example?
It allows to put arbitrary Helper-COM-Objects (no matter, whether Private Classes or Public ones from an AX-Dll) -
into the js-context... (under a certain name-string, which is then case-sensitive in js).
Over such an added Object you can then - at any time:
- "call into VB6-Code" (and thus, into "system-stuff, normally not reachable by a browser")
example-class, named cAuth (in a normal VB-Form-Project):
Code:
Option Explicit
Public Function GetWinUserName() 'a Browser does not know the logon-name of the current Win-User
GetWinUserName = Environ("username") 'so we help out with that here, via this little cAuth.Method
End Function
TestForm-Code:
Code:
Option Explicit
Private WithEvents WV As cWebView2
Private Sub Form_Load()
Set WV = New_c.WebView2(hWnd, 0) '<-- the 0 ensures async-mode
End Sub
Private Sub Form_Resize()
if Not WV Is Nothing Then WV.SyncSizeToHostWindow
End Sub
Private Sub WV_InitComplete()
WV.AddObject "Auth", New cAuth
WV.NavigateToString "<div id='user_div'></div>", 0 '<-- the 0 ensures async-mode
End Sub
Private Sub WV_DocumentComplete()
WV.ExecuteScript "document.querySelector('#user_div').textContent = 'LoggedOnUser: ' + Auth.GetWinUserName()"
End Sub
HTH
Olaf
-
Dec 11th, 2023, 02:41 PM
#464
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
"Thank you Olaf for this example.
However, I don’t see how to switch a WebView2 property inside cWebView2, like AreBrowserExtensionsEnabled to True, through this method.
-
Dec 11th, 2023, 03:11 PM
#465
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by saturnian
"Thank you Olaf for this example.
However, I don’t see how to switch a WebView2 property inside cWebView2, like AreBrowserExtensionsEnabled to True, through this method.
As said, I'll try to enable this (not yet implemented) Property (and its "sidekicks") over the holidays in a new RC6-version, which enhances cWebView2.
Why are extensions useful?
Because they allow other devs to "break out" of the restricted Browser-environment with either js - or "other (compiling) languages" -
to allow access to e.g. the FileSystem (along with anything else the Host-OS has to offer, which is not "reachable" via the built-in js-engine).
The example in my prior post was just a suggestion... showing an alternative way how to tackle basically the same thing -
(breaking out of the Browser, calling functionality of the underlying OS via VB and system-APIs) -
entirely "on your own", in a language you know well, without waiting for "plugins" to circumvent "browser-limitations".
Olaf
-
Dec 11th, 2023, 03:44 PM
#466
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
I understand better Olaf, Thank you.
In fact, in my case, I am required to use the extensions approved by the administration to validate the reading of social security cards and physician identification in the browser context. It is also the back-end of the French national shared medical records management application that addresses the extension to authenticate patients and physicians before delivering health information.
I will wait for the update of the RC6.
Best regards.
François
-
Dec 25th, 2023, 06:27 AM
#467
Fanatic Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Edit: I think the problem occurs because I prevent new windows from popping up. I will report back.
--------
Still about not receiving the PermissionRequested event for web.whatsapp.com when trying to record an audio message on one customer's computer:
My app is in the list of allowed applications.
My app is able to access the microphone for example using waveInOpen and recording a wav.
The system settings indicate that the admin takes care of system settings.
What should I do now?
Did I understand correctly that you offer to have a look at the customer's computer via Anydesk or similar?
Last edited by tmighty2; Dec 26th, 2023 at 01:09 PM.
-
Jan 8th, 2024, 10:21 PM
#468
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
I am running a script as follows:
dim script
script = "var divsListAds = document.querySelectorAll('.mt-ListAds');" & vbCrLf & _
"var hrefArray = [];" & vbCrLf & _
"divsListAds.forEach(function(div) {" & vbCrLf & _
" var links = div.querySelectorAll('a');" & vbCrLf & _
" links.forEach(function(link) {" & vbCrLf & _
" hrefArray.push(link.getAttribute('href'));" & vbCrLf & _
" });" & vbCrLf & _
"});" & vbCrLf & _
"console.log(hrefArray);" & vbCrLf & _
"window.chrome.webview.postMessage(JSON.stringify(hrefArray));"
WV.ExecuteScript script
In the console it shows me the data I need, the question is how can I pass that data to a variable or save that data in a text file, could someone help me?
-
Jan 10th, 2024, 06:00 AM
#469
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by julian1104
WV.ExecuteScript script
In the console it shows me the data I need, the question is how can I pass that data to a variable or save that data in a text file, could someone help me?
WV.ExecuteScript is not the right method to tackle such problems...
A better approach is, to encapsulate your js-Codeblock in a function...
Code:
With New_c.StringBuilder '
.AddNL "function myFunc(){"
.AddNL " var divsListAds = document.querySelectorAll('.mt-ListAds')"
.AddNL " var hrefArray = []"
.AddNL " divsListAds.forEach(function(div){"
.AddNL " var links = div.querySelectorAll('a')"
.AddNL " links.forEach(function(link){"
.AddNL " hrefArray.push(link.getAttribute('href'))"
.AddNL " })"
.AddNL " })"
.AddNL " return JSON.stringify(hrefArray)"
.AddNL "}"
WV.AddScriptToExecuteOnDocumentCreated (.ToString) 'add the function to the WV-context from StringBuilder-Content
End With
and then simply "calling it" later on (after Document-Load) via WV.jsRun()...
Code:
Debug.Print WV.jsRun("myFunc") 'call the js-Function, printing the (stringified) JSON into the VB-Debug-Window
Olaf
-
Jan 10th, 2024, 11:53 PM
#470
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
I greatly appreciate your message, I tried it but it doesn't print anything here:
Debug.Print WV.jsRun("myFunc")
I solved it this way but I don't consider it to be the most effective.
Code:
command1_click()
script = "var divsListAds = document.querySelectorAll('.mt-ListAds');" & vbCrLf & _
"var hrefArray = [];" & vbCrLf & _
"divsListAds.forEach(function(div) {" & vbCrLf & _
"var enlaces = div.querySelectorAll('a');" & vbCrLf & _
"enlaces.forEach(function(enlace) {" & vbCrLf & _
"hrefArray.push(enlace.getAttribute('href'));" & vbCrLf & _
"});" & vbCrLf & _
"});" & vbCrLf & _
"var hrefArrayString = hrefArray.join('\n');" & vbCrLf & _
"navigator.clipboard.writeText(hrefArrayString).then(function() {" & vbCrLf & _
" window.chrome.webview.postMessage('Copiado al portapapeles');" & vbCrLf & _
"});"
WV.ExecuteScript script
end sub
Last edited by julian1104; Jan 12th, 2024 at 06:34 PM.
-
Jan 12th, 2024, 06:49 AM
#471
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
I have the following code which works perfectly for me if I set breakpoints to validate the process, working perfectly this way, but if I remove the breakpoints and allow all the code to be processed, the system crashes. How could I solve it?
This information extraction is executed from a loop for which it loads a website in for and loads the data to the text boxes
Code:
dim nextdata as boolean
private sub command1_click()
for a=1 to 2
WV.Navigate pagetoloader & "/" & a
Do
DoEvents
Loop Until nextdata = True
nextdata = False
next
end sub
Code:
Private Sub WV_DocumentComplete()
if nextdata=true then
script="xxxxxx"
WV.ExecuteScript script
text1=Here I stored the variable from script in a textbox which was copied directly from the clipboard
sleep 500
script2="xxxxxx"
WV.ExecuteScript script2
text2=Here I stored the variable from script in a textbox which was copied directly from the clipboard
sleep 500
script3="xxxxxx"
WV.ExecuteScript script3
text3=Here I stored the variable from script in a textbox which was copied directly from the clipboard
sleep 500
nextdata=true
end if
end sub
The execution of the scripts are applied to each of the pages loaded in WV.Navigate pagetoloader & "/" & a
Last edited by julian1104; Jan 12th, 2024 at 07:40 PM.
-
Jan 12th, 2024, 09:35 AM
#472
Re: VB6 WebView2-Binding (Edge-Chromium)
By-passing captchas is not a topic that we allow on VBForums. Please do not discuss this topic any further.
-
Jan 16th, 2024, 03:39 PM
#473
New Member
Re: VB6 WebView2-Binding (Edge-Chromium)
I have the next element is a website.
Code:
<div class="mt-ListPagination"><ul class="sui-MoleculePagination"><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds%5B0%5D=4&ModelIds%5B0%5D=0&Versions%5B0%5D=&pg=4" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--outline sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--empty sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-leftIcon"><span class="sui-AtomIcon sui-AtomIcon--small sui-AtomIcon--currentColor"><span class="sui-AtomIcon sui-AtomIcon--small sui-AtomIcon--currentColor" svgclass="mt-ListPagination-icon"><span><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.293 11.707c0-.256.098-.512.293-.707l6-6L15 6.414l-5.293 5.293L15 17l-1.414 1.414-6-6a.997.997 0 0 1-.293-.707"></path></svg></span></span></span></span><span class="sui-AtomButton-content"></span></span></a></li><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds[0]=4&ModelIds[0]=0&Versions[0]=" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--outline sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-content">1</span></span></a></li><li class="sui-MoleculePagination-divider">···</li><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds%5B0%5D=4&ModelIds%5B0%5D=0&Versions%5B0%5D=&pg=4" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--outline sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-content">4</span></span></a></li><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds%5B0%5D=4&ModelIds%5B0%5D=0&Versions%5B0%5D=&pg=5" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--solid sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-content">5</span></span></a></li><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds%5B0%5D=4&ModelIds%5B0%5D=0&Versions%5B0%5D=&pg=6" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--outline sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-content">6</span></span></a></li><li class="sui-MoleculePagination-divider">···</li><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds%5B0%5D=4&ModelIds%5B0%5D=0&Versions%5B0%5D=&pg=257" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--outline sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-content">257</span></span></a></li><li class="sui-MoleculePagination-item"><a href="/segunda-mano/?st=2&MakeIds%5B0%5D=4&ModelIds%5B0%5D=0&Versions%5B0%5D=&pg=6" shape="circular" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--outline sui-AtomButton--center sui-AtomButton--small sui-AtomButton--link sui-AtomButton--empty sui-AtomButton--circular"><span class="sui-AtomButton-inner"><span class="sui-AtomButton-content"></span><span class="sui-AtomButton-rightIcon"><span class="sui-AtomIcon sui-AtomIcon--small sui-AtomIcon--currentColor"><span class="sui-AtomIcon sui-AtomIcon--small sui-AtomIcon--currentColor" svgclass="mt-ListPagination-icon"><span><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 11.707a.997.997 0 0 0-.293-.707l-6-6-1.414 1.414 5.293 5.293L8.293 17l1.414 1.414 6-6a.997.997 0 0 0 .293-.707"></path></svg></span></span></span></span></span></a></li></ul></div>
I have tried clicking on the last element found within it (next page).
but I don't have an answer to it, what am I doing wrong?
example 1
Code:
Dim script As String
script = "var paginationItems = document.querySelectorAll('.mt-ListPagination .sui-MoleculePagination-item');" & vbCrLf & _
"var ultimoItem = paginationItems[paginationItems.length - 1];" & vbCrLf & _
"if (ultimoItem) {" & vbCrLf & _
" ultimoItem.click();" & vbCrLf & _
"}"
WV.ExecuteScript script
example 2
Code:
Dim script As String
script = "var ultimoItem = document.querySelector('.mt-ListPagination .sui-MoleculePagination-item:last-child');" & vbCrLf & _
"if (ultimoItem) {" & vbCrLf & _
" ultimoItem.click();" & vbCrLf & _
"}"
WV.ExecuteScript script
example 3
Code:
Dim script As String
script = "var ultimoItem = document.querySelector('.mt-ListPagination .sui-MoleculePagination-item:last-child');" & vbCrLf & _
"if (ultimoItem) {" & vbCrLf & _
" var eventoClick = document.createEvent('MouseEvents');" & vbCrLf & _
" eventoClick.initEvent('click', true, true);" & vbCrLf & _
" ultimoItem.dispatchEvent(eventoClick);" & vbCrLf & _
"}"
WV.ExecuteScript script
example 4
Code:
Dim script As String
script = "var ultimoItem = document.querySelector('.mt-ListPagination .sui-MoleculePagination-item:last-child');" & vbCrLf & _
"if (ultimoItem) {" & vbCrLf & _
" ultimoItem.scrollIntoView();" & vbCrLf & _
" setTimeout(function() {" & vbCrLf & _
" var eventoClick = document.createEvent('MouseEvents');" & vbCrLf & _
" eventoClick.initEvent('click', true, true);" & vbCrLf & _
" ultimoItem.dispatchEvent(eventoClick);" & vbCrLf & _
" }, 500);" & vbCrLf & _
"}"
WV.ExecuteScript script
-
Feb 3rd, 2024, 01:30 PM
#474
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Hello Olaf,
In the BindTo function, entering a command in additionalBrowserArguments (for example, "--lang=de") prevents the initialization of WebView2 with version 6.0.15 of RC6.
What am I doing wrong?
Thank you for your assistance.
Kind regards.
François
-
Feb 4th, 2024, 02:30 AM
#475
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by saturnian
In the BindTo function, entering a command in additionalBrowserArguments
(for example, "--lang=de") prevents the initialization of WebView2 with version 6.0.15 of RC6.
Just tested this here (on Win11) - and it works as it should...
(on the sole instance of the WV-Ctl I've created)...
IIRC, there was a problem sometime ago, where it was shown -
that *every* "follow-up" WV2-instance in a given Process -
needs to be started with the same commandline-params as the first created one...
I consider that a problem MS has to fix (if it's still there).
Olaf
-
Feb 4th, 2024, 08:42 AM
#476
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by Schmidt
...
IIRC, there was a problem sometime ago, where it was shown -
that *every* "follow-up" WV2-instance in a given Process -
needs to be started with the same commandline-params as the first created one...
I consider that a problem MS has to fix (if it's still there).
Olaf
Thank you Olaf,
You are the best!
It seems that all WV2s in a Windows session need to be initialized with the same parameters. I had two other applications running, different from the one I am developing, where a WV2 was initialized in French. It was then impossible to initialize in another language in the application I am developing. As soon as I closed these 2 applications, everything worked! This is a weird behavior from MS!
Thanks again for your quick response.
Best regards,
François
-
Feb 4th, 2024, 11:11 AM
#477
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by saturnian
It seems that all WV2s in a Windows session need to be initialized with the same parameters.
Ah, yes - that was the behaviour (which was discussed a few dozen entries back, here in this thread)...
and a solution for this was (IIRC), that the behaviour can be avoided, as long as a different UserFolder was given
(e.g. one Userfolder for french-users - and one for e.g. "--lang=de"-users on the same machine...).
Olaf
-
Feb 4th, 2024, 11:31 AM
#478
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by Schmidt
Ah, yes - that was the behaviour (which was discussed a few dozen entries back, here in this thread)...
and a solution for this was (IIRC), that the behaviour can be avoided, as long as a different UserFolder was given
(e.g. one Userfolder for french-users - and one for e.g. "--lang=de"-users on the same machine...).
Olaf
Thanks Olaf, I'll try that right away
-
Feb 12th, 2024, 08:04 PM
#479
Hyperactive Member
Re: VB6 WebView2-Binding (Edge-Chromium)
Hello Olaf,
Is it possible to parse with WebView2 not a site but a local html page ? I would like to identify some controls within that html file and to change their values. For example to change a checkbox from true to false. Thank you.
"When you do things right, people won't be sure you've done anything at all" - Matt Groening
"If you wait until you are ready, it is almost certainly too late" - Seth Godin
"Believe nothing you hear, and only one half of what you see" - Edgar Allan Poe
-
Mar 2nd, 2024, 01:09 PM
#480
Addicted Member
Re: VB6 WebView2-Binding (Edge-Chromium)
 Originally Posted by Schmidt
Ah well, ...finally.
Will see what I can do in this regard over the holidays...
Olaf
Hello Olaf,
Have you made progress on the new version of RC6, particularly improving the integration of WebView2 (Extension management...) ?
Thank you for your response.
Kind regards,
François
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|