It is currently Sun May 31, 2020 6:59 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 63 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Mon Sep 02, 2019 12:27 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1111
Location: Gernsbach (Germany)
PB.Ex WebGadget 1.1.0.0 has been released.

Changelog:
  • Added: SetWebGadgetExProxy()


@zikitrake
You now have the SetWebGadgetExProxy function. I tested with 108.61.86.187:8080 (https-Proxy).

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Mon Sep 02, 2019 5:33 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 25, 2004 2:15 pm
Posts: 721
Location: Spain
Thank you :!: It works like a charm

_________________
PB 5.7x, PureVision User.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sat Sep 07, 2019 10:13 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 25, 2004 2:15 pm
Posts: 721
Location: Spain
Mr. Applicant, with a new request

Would it be possible to reassign a new proxy to an existing WebGadgetEx, when one has already been assigned previously?

Again, thank you for this lib


Edited and added :)

What is wrong in this code?
  1. Start a WebGadgetEx with a proxy.
  2. I release the Gadget and close the library.
  3. I open the library again and assign a new proxy before creating a new gadget.
But it continues to maintain the first proxy I assigned in step 1.

Code:
EnableExplicit

Global PBEx_WebGadget
Global MyWebG.l

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

Procedure.l PBEx_WebGadget_Init(id.l = -1)
  Protected ReturnID.l
  CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
    If id = -1
      ReturnID = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x86.dll")
    Else
      OpenLibrary(id, "PB.Ex_WebGadget_x86.dll")
      ReturnID = id
    EndIf   
  CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
    If id = -1
      ReturnID = OpenLibrary(#PB_Any, "PB.Ex_WebGadget_x64.dll")     
    Else
      OpenLibrary(id, "PB.Ex_WebGadget_x64.dll")
      ReturnID = id
    EndIf   
  CompilerEndIf
 
  If ReturnID
    Debug "lib ok"   
    Global WebGadgetEx.WebGadgetEx = GetFunction(ReturnID, "WebGadgetEx")
    Global SetWebGadgetExText.SetWebGadgetExText = GetFunction(ReturnID, "SetWebGadgetExText")
    Global GetWebGadgetExText.GetWebGadgetExText = GetFunction(ReturnID, "GetWebGadgetExText")
    Global SetWebGadgetExState.SetWebGadgetExState = GetFunction(ReturnID, "SetWebGadgetExState")
    Global SetWebGadgetExItemText.SetWebGadgetExItemText = GetFunction(ReturnID, "SetWebGadgetExItemText")
    Global GetWebGadgetExItemText.GetWebGadgetExItemText = GetFunction(ReturnID, "GetWebGadgetExItemText")
    Global FreeWebGadgetEx.FreeWebGadgetEx = GetFunction(ReturnID, "FreeWebGadgetEx")
    Global IsWebGadgetEx.IsWebGadgetEx = GetFunction(ReturnID, "IsWebGadgetEx")
    Global WebGadgetExWidth.WebGadgetExWidth = GetFunction(ReturnID, "WebGadgetExWidth")
    Global WebGadgetExHeight.WebGadgetExHeight = GetFunction(ReturnID, "WebGadgetExHeight")
    Global WebGadgetExX.WebGadgetExX = GetFunction(ReturnID, "WebGadgetExX")
    Global WebGadgetExY.WebGadgetExY = GetFunction(ReturnID, "WebGadgetExY")
    Global WebGadgetExID.WebGadgetExID = GetFunction(ReturnID, "WebGadgetExID")
    Global HideWebGadgetEx.HideWebGadgetEx = GetFunction(ReturnID, "HideWebGadgetEx")
    Global ResizeWebGadgetEx.ResizeWebGadgetEx = GetFunction(ReturnID, "ResizeWebGadgetEx")
    Global HideWebGadgetExDevTools.HideWebGadgetExDevTools = GetFunction(ReturnID, "HideWebGadgetExDevTools")
    Global ExecuteWebGadgetExJavaScript.ExecuteWebGadgetExJavaScript = GetFunction(ReturnID, "ExecuteWebGadgetExJavaScript")
    Global BindWebGadgetExJavaScript.BindWebGadgetExJavaScript = GetFunction(ReturnID, "BindWebGadgetExJavaScript")
    Global GetWebGadgetExAttribute.GetWebGadgetExAttribute = GetFunction(ReturnID, "GetWebGadgetExAttribute")
    Global SetWebGadgetExAttribute.SetWebGadgetExAttribute = GetFunction(ReturnID, "SetWebGadgetExAttribute")
    Global EnableRemoteDebugger.EnableRemoteDebugger = GetFunction(ReturnID, "EnableRemoteDebugger")
    Global SetWebGadgetExSetUserAgent.SetWebGadgetExSetUserAgent = GetFunction(ReturnID, "SetWebGadgetExSetUserAgent")
    Global SetWebGadgetExProxy.SetWebGadgetExProxy = GetFunction(ReturnID, "SetWebGadgetExProxy")
  Else
    ReturnID = 0
    Debug "lib fail"
    End   
  EndIf
 
  ProcedureReturn ReturnID
 
EndProcedure

Define ErrorOutput$ = Space(128)
PBEx_WebGadget = PBEx_WebGadget_Init()


OpenWindow(0, 0, 0, 1200, 768, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWebGadgetExProxy("104.236.248.219:3128", @ErrorOutput$);https://www.proxy-list.download/HTTPS
MyWebG = WebGadgetEx(#PB_Any, 0, 20, 1200, 748, "https://www.myip.com/", WindowID(0), @ErrorOutput$)

While GetWebGadgetExAttribute(MyWebG, #PB_Web_Busy, @ErrorOutput$)
  WindowEvent()
Wend

FreeWebGadgetEx(MyWebG, @ErrorOutput$) 
CloseLibrary(PBEx_WebGadget)

;Open a New WebGadgetEx with a New Proxy

PBEx_WebGadget = PBEx_WebGadget_Init()

SetWebGadgetExProxy("116.203.127.92:3128", @ErrorOutput$);https://www.proxy-list.download/HTTPS
UseGadgetList(WindowID(0))
MyWebG = WebGadgetEx(#PB_Any, 0, 20, 1200, 748, "https://www.myip.com/", WindowID(0), @ErrorOutput$)

While GetWebGadgetExAttribute(MyWebG, #PB_Web_Busy, @ErrorOutput$)
  WindowEvent()
Wend

Repeat
Until WindowEvent() = #PB_Event_CloseWindow
CloseLibrary(PBEx_WebGadget)

_________________
PB 5.7x, PureVision User.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Wed Sep 11, 2019 2:42 pm 
Offline
New User
New User

Joined: Wed Sep 11, 2019 2:35 pm
Posts: 2
Hi, Incredible work !

These offers many new way to use Purebasic with HTML GUI.

Is there a way to store DLLs and CEF package outside of the app folder?

Regards !


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Mon Sep 23, 2019 10:01 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 25, 2004 2:15 pm
Posts: 721
Location: Spain
Hi RSBasic,

Is it normal that SetWebGadgetExText() always returns 1, even if the internet connection is interrupted?

_________________
PB 5.7x, PureVision User.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Wed Sep 25, 2019 9:17 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 541
@fouines

Quote:
Is there a way to store DLLs and CEF package outside of the app folder?

It seems also not be possible with electron famework.

But, You can put all those things included (IncludeBinary) in Your source and write it out at runtime.
Did that for other things and it worked seemless.

Seems like a lot of work, but the result is a clean, simple (even bigger) executable.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Oct 17, 2019 7:40 am 
Offline
User
User

Joined: Thu Oct 17, 2019 7:30 am
Posts: 10
Hello!
The ExecuteWebGadgetExJavaScript function does not return the result to javascript if it is carried out from a flow.

Code:

EnableExplicit

Global PBEx_WebGadget

Enumeration
  #win
EndEnumeration

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")
CompilerEndIf

If PBEx_WebGadget
  Prototype WebGadgetEx(ID, X, Y, Width, Height, URL.p-Unicode, ParentWindowID, ErrorOutput)
  Global WebGadgetEx.WebGadgetEx = GetFunction(PBEx_WebGadget, "WebGadgetEx")
  Prototype ExecuteWebGadgetExJavaScript(ID, Code.p-Unicode, Output, ErrorOutput)
  Global ExecuteWebGadgetExJavaScript.ExecuteWebGadgetExJavaScript = GetFunction(PBEx_WebGadget, "ExecuteWebGadgetExJavaScript")
  Prototype GetWebGadgetExAttribute(ID, Attribute, ErrorOutput)
  Global GetWebGadgetExAttribute.GetWebGadgetExAttribute = GetFunction(PBEx_WebGadget, "GetWebGadgetExAttribute")
  Prototype SetWebGadgetExSetUserAgent(UserAgent.p-Unicode, ErrorOutput)
  Global SetWebGadgetExSetUserAgent.SetWebGadgetExSetUserAgent = GetFunction(PBEx_WebGadget, "SetWebGadgetExSetUserAgent")
  Prototype SetWebGadgetExProxy(Proxy.p-Unicode, ErrorOutput)
  Global SetWebGadgetExProxy.SetWebGadgetExProxy = GetFunction(PBEx_WebGadget, "SetWebGadgetExProxy")
 
EndIf

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

Procedure GetCookiePage(*gadg)
  Protected Output$, ErrorOutput$
 
  Repeat
    If GetWebGadgetExAttribute(*gadg, #PB_Web_Busy, @ErrorOutput$) = 0
      ExecuteWebGadgetExJavaScript(*gadg, "document.cookie;", @Output$, @ErrorOutput$)
      If Output$
        Debug "Cookie:"+Output$
        Break
      EndIf
    EndIf
   
    Delay(1000)
 
  Until  Output$
EndProcedure


Define lu
If OpenWindow(#win, 0, 0, 1200, 768, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
 
 
  lu = WebGadgetEx(#PB_Any, 0, 20, 1200, 748, "https://stackoverflow.com", WindowID(0), @ErrorOutput$)
 
  CreateThread(@GetCookiePage(), lu)
 
  ButtonGadget(2, 0, 0, 70, 20, "Get Cookie", 0)
 
  Repeat
   
    Select WaitWindowEvent()
      Case #PB_Event_Gadget
        Select EventGadget()
          Case 2
           
            Repeat
             
              If GetWebGadgetExAttribute(lu, #PB_Web_Busy, @ErrorOutput$) = 0
                ExecuteWebGadgetExJavaScript(lu, "document.cookie;", @Output$, @ErrorOutput$)
                If Output$
                  Debug "Cookie:"+Output$
                  Break
                EndIf
              EndIf
              Delay(1000)
             
            Until  Output$
           
        EndSelect
      Case #PB_Event_CloseWindow
        CloseLibrary(PBEx_WebGadget)
        End
    EndSelect
   
  ForEver
EndIf

Whether it is possible as that to correct?

Also from a flow the WebGadgetEx function does not work.


I thank!


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Oct 17, 2019 8:49 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 25, 2004 2:15 pm
Posts: 721
Location: Spain
souk wrote:
Hello!...
I thank!

Code:
Procedure GetCookiePage(*gadg)
  Protected Output$ = Space(1024)
  Protected ErrorOutput$ = Space(1024)
 
  ;Wait until the page is fully loaded
  While GetWebGadgetExAttribute(*gadg, #PB_Web_Busy, @ErrorOutput$)
    Delay(10)
  Wend 
 
  Repeat
    If GetWebGadgetExAttribute(*gadg, #PB_Web_Busy, @ErrorOutput$) = 0
      ExecuteWebGadgetExJavaScript(*gadg, "document.cookie;", @Output$, @ErrorOutput$)
      If Output$
        Debug "Cookie:"+Output$
        Break
      EndIf
    EndIf
   
    Delay(1000)
 
  Until  Output$
EndProcedure


The thread needs to wait until the page is fully loaded

_________________
PB 5.7x, PureVision User.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Oct 17, 2019 9:49 am 
Offline
User
User

Joined: Thu Oct 17, 2019 7:30 am
Posts: 10
Many thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Oct 17, 2019 10:48 am 
Offline
User
User

Joined: Thu Oct 17, 2019 7:30 am
Posts: 10
zikitrake wrote:

The thread needs to wait until the page is fully loaded


And how still it is possible to receive cookie with webgadget with HttpOnly flag?
Javascript does not take cookie with HttpOnly flag.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Dec 05, 2019 9:20 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 09, 2011 8:58 am
Posts: 588
If I want to use the latest CEF available, how to proceed? Is it OK to just download the latest CEF and drop it over the existing one, or are there more steps (rebuilding some files, etc) in the process?

_________________
My new project: A simple HTML/CSS UI engine for PB desktop apps
viewtopic.php?f=7&t=74582


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Fri Dec 27, 2019 4:59 pm 
Offline
New User
New User

Joined: Fri Dec 27, 2019 4:57 pm
Posts: 1
Great module!

But it's using an old version of Chromium. Is there a newer version available?
And is the source for the PureBasic DLL available?


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Mon Jan 13, 2020 5:56 pm 
Offline
Enthusiast
Enthusiast
User avatar

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

I just discovered your PB.Ex_WebGadget ... WOW, that's brilliant ... how could I have missed it for so long? Image
Ok ... I wasn't active for wayyyy to long. :wink:

As a PBler who struggled a lot with the genuine WebGadget, this looks very promising.

Will there be any chance, you could implement some of the following functionalities into PB.Ex_WebGadget?

To handle Events:
- BindWebEvent() - to receive and process Events, received by WegBadgetEx() (like Events on incoming Push-Data)

To communicate with Page-Elements:
- ExamineElements() - to examine the Elements included in the actual WebPage (like text- & string-fields, Buttons, etc.)
- GetElementProperties() - to get Info about the actual examined Element (like Name, Type (Text/String/Button/Image/etc.), Value (e.g. Text, URL), ...)
- SetElementProperties() - to set Values of an Element (like Value (e.g. Text of a String-Element), or clicking a Button, ...)

To work with plane Page-Text:
- SetWebGadgetExState() - with State = #PBEx_Web_SelectAll, to select the whole Text.
- GetWebGadgetExItemText() - with Entry = #PB_Web_SelectedText
(Or even better, add Entry = #PBEx_Web_AllText, to get the full Text, without the need of selecting the whole Text first.

This could make the communication with Web-Content sooooooo much easier !!!

As an example what I'm doing so far using the genuine WebGadget:
E.g. on THIS or THIS site, the Stock-Values are changing all the time during stock-hours (by JS and pushed data?), but the HTML-Code does not change - so I cannot process the HTML-code to get actual Values.
So far I send a mouseclick to the Webgadget to activate it (just ActivateGadget() does not work), then I send a "Select-All" Keyboard-Event (Ctrl-A) to the WebGadget to select all the text and then I use #PB-Web_SelectedText to get and process the Text.
Further, because I did not get a clear Event when the WebGadget() has received pushed Data and changed Values, I have to get and process the text way to often, or even loose some changed Data.

Would be great if some of these functionalities could be included in WebGadgetEx().

But anyway ... thanks a lot for this great WebGadget-Replacement !!! :mrgreen:

Happy Greetings 'aus der Eifel',
PureLust.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sun Feb 02, 2020 5:08 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1111
Location: Gernsbach (Germany)
PB.Ex WebGadget 1.1.1.0 has been released

Changelog:
  • Updated: Chromium version 79

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sun Feb 02, 2020 5:41 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Nov 09, 2011 8:58 am
Posts: 588
RSBasic wrote:
PB.Ex WebGadget 1.1.1.0 has been released

Changelog:
  • Updated: Chromium version 79


Thanks a lot, very appreciated 8)

_________________
My new project: A simple HTML/CSS UI engine for PB desktop apps
viewtopic.php?f=7&t=74582


Top
 Profile  
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  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 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