Looking for somebody who is really good at JS and VB6

Closed Posted 1 year ago Paid on delivery
Closed Paid on delivery

Hello!

I am using the following VB6 browser:

[login to view URL](Edge-Chromium)/page8

I have posted a question there, and this is the reply that I got and why I am now looking for somebody who can do it:

I'd ask the developer who has programmed the C# interaction (with CEF),

to write a similar js-function for you...

WebView2 is using chromium as well, but as said, the DOM-interfaces are not exposed to the VB/COM-side here.

Therefore you have to use "preloaded js-functions" to interact with the Browser-DOM "on the inside" of WV2 -

and communicate with the outside via JSON-strings.

Such a C#->js-v8 porting should not be that hard for the developer, who originally wrote the C#-stuff.

All I can do here from my end, is to show you the "principle".

Code:

Option Explicit

Private WithEvents WV As cWebView2, Elements As cCollection

Private Sub Form_Load()

Visible = True

Set WV = [login to view URL](hWnd)

With [login to view URL] 'js-helpers

.AddNL "function getElements(sExpr){"

.AddNL " var resArr = []"

.AddNL " for (var e of [login to view URL](sExpr).values()){"

.AddNL " [login to view URL]({tag:[login to view URL], id:[login to view URL], val:[login to view URL], name:[login to view URL], href:[login to view URL]})"

.AddNL " }"

.AddNL " return [login to view URL](resArr)"

.AddNL "}"

.AddNL "function setElementBackgroundById(id, color){"

.AddNL " [login to view URL]('#'+id).[login to view URL] = color"

.AddNL "}"

[login to view URL] .ToString

End With

With [login to view URL] 'two anchors and two buttons as test-HTML-content

.AddNL "<a id='a1' href='#foo'>LinkFoo</a><br>"

.AddNL "<input id='b1' type='button' value='button 1'><br>"

.AddNL "<a id='a2' href='#bar'>LinkBar</a><br>"

.AddNL "<input id='b2' type='button' value='button 2'><br>"

[login to view URL] .ToString

End With

'retrieve a few elements "by selector-expression"

Set Elements = [login to view URL]([login to view URL]("getElements", "a, input"))

Dim Elmt As cCollection 'the enumerated Elements themselves are (again) of type cCollection - but hold a JSON-Object instead of a JSON-array

For Each Elmt In Elements 'iteration over the gathered Element-Objects in the JSON-Array: Elements

[login to view URL] [login to view URL] 'just to show, which properties are contained "per element"

Select Case UCase$(Elmt("tag")) 'first Property-access on an Element (here the "tag"-Property)

Case "A": [login to view URL] "setElementBackgroundById", Elmt("id"), "#f00"

Case "INPUT": [login to view URL] "setElementBackgroundById", Elmt("id"), "#0f0"

End Select

Next

End Sub

... but the adaption of the above shown principle (to your concrete problem), really is your part.

JavaScript Visual Basic

Project ID: #36312407

About the project

11 proposals Remote project Active 1 year ago

11 freelancers are bidding on average €45 for this job

mobimubasir

Hello. I read your requirement and also check attachment link i will do that. Please come on chat we will discuss more about this. I will waiting your reply.

€50 EUR in 1 day
(4 Reviews)
2.4
Yasirirfan06

Hello, My name is Yasir and I have read the details I believe I can do this job. While I believe I have some queries which need to be clarified. For that I would request you to start the chat so we could clarify those More

€35 EUR in 1 day
(5 Reviews)
2.1
fatimahassan038

Hello. I read your request and will also verify the attachment link. Please join the conversation so we can talk more about this. I'm waiting for your response.

€40 EUR in 1 day
(2 Reviews)
1.1
maazwork270

Hi, I am professional in JavaScript , C++ and C#. Before working on it I have few questions on my mind. Kindly contact me ASAP so I can start working on this project. Best Regards Syed

€30 EUR in 1 day
(1 Review)
0.6
engineerwinnie

CERTIFIED ENGINEER, EXPERT IN ENGINEERING&SCIENCE, Dear Client, I have Keenly gone through your project requirements as given in your project description. I gladly inform you that i am in possession of all clearly sta More

€50 EUR in 5 days
(0 Reviews)
0.0