Changelog:
- Added: SetWebGadgetExProxy()
@zikitrake
You now have the SetWebGadgetExProxy function. I tested with 108.61.86.187:8080 (https-Proxy).
Code: Select all
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)
It seems also not be possible with electron famework.Is there a way to store DLLs and CEF package outside of the app folder?
Code: Select all
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
souk wrote:Hello!...
I thank!
Code: Select all
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
And how still it is possible to receive cookie with webgadget with HttpOnly flag?zikitrake wrote:
The thread needs to wait until the page is fully loaded
Thanks a lot, very appreciatedRSBasic wrote:PB.Ex WebGadget 1.1.1.0 has been released
Changelog:
- Updated: Chromium version 79