It is currently Thu May 28, 2020 4:36 pm

All times are UTC + 1 hour

Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sun Feb 02, 2020 11:57 pm 
User avatar

Joined: Thu Mar 25, 2004 2:15 pm
Posts: 721
Location: Spain
Thank you RSBasic. It's working nice.

A question to all users of it:

In the following code a text is sent to DeepL but it is not translated until you click on the TextArea source and press Enter.
How is it possible to make a simulation of this operation (send click and type "Enter")

I use the following code to simulate the enter key, but it doesn't work :S
  ;Focus and press Enter
  script$ +  " textAreaOne.focus();" + #CRLF$
  script$ + ~" const ke = new KeyboardEvent(\"keydown\", {" + #CRLF$
  script$ +  " bubbles: true, cancelable: true, keyCode: 13});" + #CRLF$
  script$ +  " textAreaOne.dispatchEvent(ke);" + #CRLF$

Main Code



Global PBEx_WebGadget

#PBEx_WebGadgetEx_Version$ = ""
#PB_Web_Zoom               = 100

CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
  PBEx_WebGadget = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x86.dll")
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
  PBEx_WebGadget = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x64.dll")

Prototype WebGadgetEx(ID, X, Y, Width, Height, URL.p-Unicode, ParentWindowID, ErrorOutput)
Global WebGadgetEx.WebGadgetEx = GetFunction(PBEx_WebGadget, "WebGadgetEx")
Prototype SetWebGadgetExText(ID, URL.p-Unicode, ErrorOutput)
Global SetWebGadgetExText.SetWebGadgetExText = GetFunction(PBEx_WebGadget, "SetWebGadgetExText")
Prototype GetWebGadgetExText(ID, Output, ErrorOutput)
Global GetWebGadgetExText.GetWebGadgetExText = GetFunction(PBEx_WebGadget, "GetWebGadgetExText")
Prototype SetWebGadgetExState(ID, State, ErrorOutput)
Global SetWebGadgetExState.SetWebGadgetExState = GetFunction(PBEx_WebGadget, "SetWebGadgetExState")
Prototype SetWebGadgetExItemText(ID, Entry, Text.p-Unicode, ErrorOutput)
Global SetWebGadgetExItemText.SetWebGadgetExItemText = GetFunction(PBEx_WebGadget, "SetWebGadgetExItemText")
Prototype GetWebGadgetExItemText(ID, Entry, Output, ErrorOutput)
Global GetWebGadgetExItemText.GetWebGadgetExItemText = GetFunction(PBEx_WebGadget, "GetWebGadgetExItemText")
Prototype FreeWebGadgetEx(ID, ErrorOutput)
Global FreeWebGadgetEx.FreeWebGadgetEx = GetFunction(PBEx_WebGadget, "FreeWebGadgetEx")
Prototype IsWebGadgetEx(ID, ErrorOutput)
Global IsWebGadgetEx.IsWebGadgetEx = GetFunction(PBEx_WebGadget, "IsWebGadgetEx")
Prototype WebGadgetExWidth(ID, ErrorOutput)
Global WebGadgetExWidth.WebGadgetExWidth = GetFunction(PBEx_WebGadget, "WebGadgetExWidth")
Prototype WebGadgetExHeight(ID, ErrorOutput)
Global WebGadgetExHeight.WebGadgetExHeight = GetFunction(PBEx_WebGadget, "WebGadgetExHeight")
Prototype WebGadgetExX(ID, ErrorOutput)
Global WebGadgetExX.WebGadgetExX = GetFunction(PBEx_WebGadget, "WebGadgetExX")
Prototype WebGadgetExY(ID, ErrorOutput)
Global WebGadgetExY.WebGadgetExY = GetFunction(PBEx_WebGadget, "WebGadgetExY")
Prototype WebGadgetExID(ID, ErrorOutput)
Global WebGadgetExID.WebGadgetExID = GetFunction(PBEx_WebGadget, "WebGadgetExID")
Prototype HideWebGadgetEx(ID, State, ErrorOutput)
Global HideWebGadgetEx.HideWebGadgetEx = GetFunction(PBEx_WebGadget, "HideWebGadgetEx")
Prototype ResizeWebGadgetEx(ID, X, Y, Width, Height, ErrorOutput)
Global ResizeWebGadgetEx.ResizeWebGadgetEx = GetFunction(PBEx_WebGadget, "ResizeWebGadgetEx")
Prototype HideWebGadgetExDevTools(ID, State, ErrorOutput)
Global HideWebGadgetExDevTools.HideWebGadgetExDevTools = GetFunction(PBEx_WebGadget, "HideWebGadgetExDevTools")
Prototype ExecuteWebGadgetExJavaScript(ID, Code.p-Unicode, Output, ErrorOutput)
Global ExecuteWebGadgetExJavaScript.ExecuteWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "ExecuteWebGadgetExJavaScript")
Prototype BindWebGadgetExJavaScript(ID, PBProcedureName.p-Unicode, PBProcedureHandle, PID, ErrorOutput)
Global BindWebGadgetExJavaScript.BindWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "BindWebGadgetExJavaScript")
Prototype GetWebGadgetExAttribute(ID, Attribute, ErrorOutput)
Global GetWebGadgetExAttribute.GetWebGadgetExAttribute = GetFunction(PBEx_WebGadget, "GetWebGadgetExAttribute")
Prototype SetWebGadgetExAttribute(ID, Attribute, Value, ErrorOutput)
Global SetWebGadgetExAttribute.SetWebGadgetExAttribute = GetFunction(PBEx_WebGadget, "SetWebGadgetExAttribute")
Prototype EnableRemoteDebugger(Port, ErrorOutput)
Global EnableRemoteDebugger.EnableRemoteDebugger = GetFunction(PBEx_WebGadget, "EnableRemoteDebugger")
Prototype SetWebGadgetExSetUserAgent(UserAgent.p-Unicode, ErrorOutput)
Global SetWebGadgetExSetUserAgent.SetWebGadgetExSetUserAgent = GetFunction(PBEx_WebGadget, "SetWebGadgetExSetUserAgent")

Define Output$      = Space(1000000)
Define ErrorOutput$ = Space(128)

Procedure Delay2(waitTime.f)
  Protected tini.f
  tini = GetTickCount_()
  Until GetTickCount_() - tini > waitTime

If OpenWindow(0, 0, 0, 1200, 768, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ;SetWebGadgetExSetUserAgent("PureBasic Bot", @ErrorOutput$)
  WebGadgetEx(1, 0, 20, 1200, 748, "", WindowID(0), @ErrorOutput$)
  Define textOrigin$ = "Hello, World.\n"
  Define script$ = "textAreaOne = document.querySelector('#dl_translator > div.lmt__sides_container > div.lmt__side_container.lmt__side_container--source > div.lmt__textarea_container > div > textarea');" + #CRLF$
  script$ + "textAreaOne.innerText = '" + textOrigin$ + "';"
  ;Focus and press Enter
  script$ +  " textAreaOne.focus();" + #CRLF$
  script$ + ~" const ke = new KeyboardEvent(\"keydown\", {" + #CRLF$
  script$ +  " bubbles: true, cancelable: true, keyCode: 13});" + #CRLF$
  script$ +  " textAreaOne.dispatchEvent(ke);" + #CRLF$
  ExecuteWebGadgetExJavaScript(1, script$, @Output$, @ErrorOutput$)
  Debug ErrorOutput$
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow

Thank you in advance

PB 5.7x, PureVision User.

Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Feb 06, 2020 7:06 pm 
User avatar

Joined: Mon Apr 16, 2007 3:57 am
Posts: 459
Location: Germany, NRW
Hi Ray,

any chance to get or bind Events like #PB_EventType_TitleChange or #PB_EventType_DownloadEnd?

Thanx and Greets, PL.

[Dynamic-Dialogs] - create complex GUIs the easy way
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)

Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sun Feb 23, 2020 6:41 pm 

Joined: Thu May 17, 2007 8:35 pm
Posts: 113
Location: USA
Using actual chrome browser, going to this page: ... ideo-test/

You can play the video.

Using that link from within the .pb test program the video cannot be played.

from within the .pb test program, says

H.264 support - NO

But within Chrome browser says

H.264 support - YES

Testing both chrome browser and the test .pb at version Chrome/79.0.3945.130

any idea what is missing in your version of chromium that is not allowing the video to play? Is there a .dll missing or not up to date? Or some other aspect of the the included files that needs to be updated? Both are displaying that version (actual browser and the .pb example when runs), but the .pb example is missing H.264 support. In fact that is the ONLY difference reported in the two at

I hope you can help with this, as.. other than not being able to have the videos on my site work, everything else seems to be working. Maybe the core subprocess or the pb.ex .dll ?

EDIT: I saw this?! ... mp4-videos ... -framework ... 2b331da367

Is it possible to get latest chromium compiled with wrapper updated by you and add this ability?

Many sites are using html5 and videos encoded with H264. The compile of the chromium framework you did does not have this support. However there are compiles that DO have it, and this would be very helpful to many of us!

I would do it myself but I am not sure exactly the steps you followed to get the final CEF and chromium files necessary that your wrapper .dll is looking for.

This link may give you more information: ... 64-support

For instance the version of chromium here: ...

On this page:

was compiled and supports h264 codec, which you can check here:

If I could just replace files from the Chromium bin to accomplish this I would, but apparently the entire CEF sharp project has to be redone, etc. and I do not know the steps. It probably would only take you a few minutes to download the new chromium that has h264 enabled in it already and recompile, etc.


Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 6 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye