It is currently Wed Nov 20, 2019 5:51 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 55 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Wed Apr 24, 2019 6:03 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
Hello

If you want to use the WebGadget, you always have the problem under Windows that Internet Explorer 7 is used by default.
With Internet Explorer 7 you cannot display many websites without Javascript errors. Also HTML5 and CSS3 are not supported.
It is always necessary to make a setting in the registry for your own program.

Under Linux you don't have the problem because the WebKit engine is used there.
If you also want to use the WebKit engine under Windows, you can use my library and display any modern website without errors.

Functions:
  • WebGadgetEx()
    • Syntax:
      Code:
      Result = WebGadgetEx(ID, X, Y, Width, Height, URL$, ParentWindowID, @ErrorOutput$)

    • Description: Creates a WebGadget with the WebKit engine.
    • Parameter:
      1. ID: A unique number for the gadget. #PB_Any can be used to generate the number automatically.
      2. X: Defines the position.
      3. Y: Defines the position.
      4. Width: Sets the width.
      5. Height: Sets the height.
      6. URL$: The address of the website you want to open.
      7. ParentWindowID: Specifies the target window in which the gadget will be created.
      8. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful. If #PB_Any is used, the ID is returned.
    • Example :
      Code:
      ;Version: 1.1.0.0

      EnableExplicit

      Global PBEx_WebGadget

      #PBEx_WebGadgetEx_Version$ = "1.1.0.0"
      #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")
      CompilerEndIf

      If PBEx_WebGadget
        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")
        Prototype SetWebGadgetExProxy(Proxy.p-Unicode, ErrorOutput)
        Global SetWebGadgetExProxy.SetWebGadgetExProxy = GetFunction(PBEx_WebGadget, "SetWebGadgetExProxy")
       
      EndIf

      Define Output$ = Space(1000000)
      Define ErrorOutput$ = Space(128)
      Define IsDevTools = #True

      Procedure MyJSCallback(aaa)
        Debug "This procedure was executed from Javascript: " + PeekS(aaa)
      EndProcedure

      If OpenWindow(0, 0, 0, 1200, 768, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
        ;SetWebGadgetExSetUserAgent("PureBasic Bot", @ErrorOutput$)
        ;SetWebGadgetExProxy("108.61.86.187:8080", @ErrorOutput$);https://www.proxy-list.download/HTTPS
       
        WebGadgetEx(1, 0, 20, 1200, 748, "http://www.rsbasic.de", WindowID(0), @ErrorOutput$)
        ;WebGadgetEx(1, 0, 20, 1200, 748, "https://www.whatismybrowser.com/detect/what-is-my-user-agent", WindowID(0), @ErrorOutput$)
        ButtonGadget(2, 0, 0, 50, 20, "Back", 0)
        ButtonGadget(3, 50, 0, 50, 20, "Forward", 0)
        ButtonGadget(4, 100, 0, 50, 20, "Reload", 0)
        ButtonGadget(5, 150, 0, 50, 20, "Stop", 0)
        ButtonGadget(6, 200, 0, 50, 20, "Google", 0)
        ButtonGadget(7, 250, 0, 70, 20, "Own HTML", 0)
        ButtonGadget(8, 320, 0, 70, 20, "Get HTML", 0)
        ButtonGadget(10, 390, 0, 70, 20, "Get URL", 0)
        ButtonGadget(11, 460, 0, 100, 20, "Get size && position", 0)
        ButtonGadget(12, 560, 0, 50, 20, "Get ID", 0)
        ButtonGadget(13, 610, 0, 50, 20, "Hide", 0)
        ButtonGadget(14, 660, 0, 50, 20, "Show", 0)
        ButtonGadget(15, 710, 0, 50, 20, "Size", 0)
        ButtonGadget(16, 760, 0, 100, 20, "Show/Hide DevT.", 0)
        ButtonGadget(17, 860, 0, 70, 20, "Execute JS", 0)
        ButtonGadget(18, 930, 0, 50, 20, "BindProc", 0)
        ButtonGadget(19, 980, 0, 50, 20, "CallProc", 0)
        ButtonGadget(20, 1030, 0, 50, 20, "IsBusy?", 0)
        ButtonGadget(21, 1080, 0, 50, 20, "GetZoom", 0)
        ButtonGadget(22, 1130, 0, 60, 20, "Zoom=200", 0)
       
        Repeat
          Select WaitWindowEvent()
            Case #PB_Event_Gadget
              Select EventGadget()
                Case 2
                  SetWebGadgetExState(1, #PB_Web_Back, @ErrorOutput$)
                Case 3
                  SetWebGadgetExState(1, #PB_Web_Forward, @ErrorOutput$)
                Case 4
                  SetWebGadgetExState(1, #PB_Web_Refresh, @ErrorOutput$)
                Case 5
                  SetWebGadgetExState(1, #PB_Web_Stop, @ErrorOutput$)
                Case 6
                  SetWebGadgetExText(1, "http://www.google.de", @ErrorOutput$)
                Case 7
                  SetWebGadgetExItemText(1, #PB_Web_HtmlCode, "<html><head></head><body><h1>Hello PureBasic Friends!</h1></body></html>", @ErrorOutput$)
                Case 8
                  GetWebGadgetExItemText(1, #PB_Web_HtmlCode, @Output$, @ErrorOutput$)
                  Debug Output$
                Case 10
                  GetWebGadgetExText(1, @Output$, @ErrorOutput$)
                  Debug Output$
                Case 11
                  Debug WebGadgetExWidth(1, @ErrorOutput$)
                  Debug WebGadgetExHeight(1, @ErrorOutput$)
                  Debug WebGadgetExX(1, @ErrorOutput$)
                  Debug WebGadgetExY(1, @ErrorOutput$)
                Case 12
                  Debug WebGadgetExID(1, @ErrorOutput$)
                Case 13
                  HideWebGadgetEx(1, 1, @ErrorOutput$)
                Case 14
                  HideWebGadgetEx(1, 0, @ErrorOutput$)
                Case 15
                  ResizeWebGadgetEx(1, 100, 50, 200, 400, @ErrorOutput$)
                Case 16
                  IsDevTools ! #True
                  HideWebGadgetExDevTools(1, IsDevTools, @ErrorOutput$)
                Case 17
                  ExecuteWebGadgetExJavaScript(1, "document.body.style.backgroundColor = " + Chr(34) + "#ff0000" + Chr(34), @Output$, @ErrorOutput$)
                  ExecuteWebGadgetExJavaScript(1, "document.body.offsetHeight;", @Output$, @ErrorOutput$)
                  Debug Output$
                  ;If you want to run modal dialogs like Alert(), please set the parameter "Output" to 0.
                  ExecuteWebGadgetExJavaScript(1, "alert('Hello');", 0, @ErrorOutput$)
                Case 18
                  BindWebGadgetExJavaScript(1, "MyJSCallback", @MyJSCallback(), GetCurrentProcessId_(), @ErrorOutput$)
                Case 19
                  ExecuteWebGadgetExJavaScript(1, "(async function() { await CefSharp.BindObjectAsync('PBProcedure'); PBProcedure.call('MyJSCallback', 'Hello PureBasic'); })();", @Output$, @ErrorOutput$)
                Case 20
                  Debug GetWebGadgetExAttribute(1, #PB_Web_Busy, @ErrorOutput$)
                Case 21
                  Debug GetWebGadgetExAttribute(1, #PB_Web_Zoom, @ErrorOutput$)
                Case 22
                  SetWebGadgetExAttribute(1, #PB_Web_Zoom, 200, @ErrorOutput$)
              EndSelect
            Case #PB_Event_CloseWindow
              CloseLibrary(PBEx_WebGadget)
              End
          EndSelect
        ForEver
      EndIf

  • SetWebGadgetExText()
    • Syntax:
      Code:
      Result = SetWebGadgetExText(ID, URL$, @ErrorOutput$)

    • Description: The address of the website you want to open.
    • Parameter:
      1. ID: The number of the created gadget.
      2. URL$: The address of the website you want to open.
      3. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetWebGadgetExText()
    • Syntax:
      Code:
      Result = GetWebGadgetExText(ID, @Output$, @ErrorOutput$)

    • Description: Determines the current address of the called website.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @Output$: The address of the website is stored in this variable.
      3. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetWebGadgetExState()
    • Syntax:
      Code:
      Result = SetWebGadgetExState(ID, State, @ErrorOutput$)

    • Description: Performs an action.
    • Parameter:
      1. ID: The number of the created gadget.
      2. State: One of the following actions can be used:
        • #PB_Web_Back: One step back in the navigation history.
        • #PB_Web_Forward: One step forward in the navigation history.
        • #PB_Web_Refresh: Reload page.
        • #PB_Web_Stop: Cancel the operation of a page that is still being loaded.
      3. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetWebGadgetExItemText()
    • Syntax:
      Code:
      Result = SetWebGadgetExItemText(ID, Entry, Text$, @ErrorOutput$)

    • Description: Performs an action.
    • Parameter:
      1. ID: The number of the created gadget.
      2. Entry: One of the following actions can be used:
        • #PB_Web_HtmlCode: Changes the page source text.
      3. Text$: The value for the action.
      4. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetWebGadgetExItemText()
    • Syntax:
      Code:
      Result = GetWebGadgetExItemText(ID, Entry, @Output, @ErrorOutput$)

    • Description: Performs an action.
    • Parameter:
      1. ID: The number of the created gadget.
      2. Entry: One of the following actions can be used:
        • #PB_Web_HtmlCode: Returns the page source code.
      3. @Output: The value of the action is saved in the variable.
      4. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • FreeWebGadgetEx()
    • Syntax:
      Code:
      Result = FreeWebGadgetEx(ID, @ErrorOutput$)

    • Description: Free the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • IsWebGadgetEx()
    • Syntax:
      Code:
      Result = IsWebGadgetEx(ID, @ErrorOutput$)

    • Description: Checks if the gadget is still valid.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The gadget is valid.
  • WebGadgetExWidth()
    • Syntax:
      Code:
      Result = WebGadgetExWidth(ID, @ErrorOutput$)

    • Description: Determines the width of the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value: The width of the gadget.
  • WebGadgetExHeight()
    • Syntax:
      Code:
      Result = WebGadgetExHeight(ID, @ErrorOutput$)

    • Description: Determines the height of the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value: The height of the gadget.
  • WebGadgetExX()
    • Syntax:
      Code:
      Result = WebGadgetExX(ID, @ErrorOutput$)

    • Description: Determines the position of the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value: The position of the gadget.
  • WebGadgetExY()
    • Syntax:
      Code:
      Result = WebGadgetExY(ID, @ErrorOutput$)

    • Description: Determines the position of the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value: The position of the gadget.
  • WebGadgetExID()
    • Syntax:
      Code:
      Result = WebGadgetExID(ID, @ErrorOutput$)

    • Description: Determines the handle number of the created gadget. The handle number can be used for WinAPI.
    • Parameter:
      1. ID: The number of the created gadget.
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value: The handle number of the gadget.
  • HideWebGadgetEx()
    • Syntax:
      Code:
      Result = HideWebGadgetEx(ID, State, @ErrorOutput$)

    • Description: Hides or displays the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. State:
        • 0: Show gadget.
        • 1: Hide Gadget.
      3. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • ResizeWebGadgetEx()
    • Syntax:
      Code:
      Result = ResizeWebGadgetEx(ID, X, Y, Width, Height, @ErrorOutput$)

    • Description: Changes the position and size of the gadget.
    • Parameter:
      1. ID: The number of the created gadget.
      2. X: Change the position of the gadget. #PB_Ignore can be used to ignore the parameter.
      3. Y: Change the position of the gadget. #PB_Ignore can be used to ignore the parameter.
      4. Width: Change the width of the gadget. #PB_Ignore can be used to ignore the parameter.
      5. height: Change the height of the gadget. #PB_Ignore can be used to ignore the parameter.
      6. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • HideWebGadgetExDevTools()
    • Syntax:
      Code:
      Result = HideWebGadgetExDevTools(ID, State, @ErrorOutput$)

    • Description: Hides or displays the development environment. This allows you to analyze the source code.
    • Parameter:
      1. ID: The number of the created gadget.
      2. State:
        • 0: Show
        • 1: Hide
      3. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • ExecuteWebGadgetExJavaScript()
    • Syntax:
      Code:
      Result = ExecuteWebGadgetExJavaScript(ID, Code$, @Output$, @ErrorOutput$)

    • Description: Executes any Javascript code. Hint: If you want to execute modal dialogs like Alert(), the parameter "Output" must be set to 0.
    • Parameter:
      1. ID: The number of the created gadget.
      2. Code$: Javascript code that is to be executed.
      3. @Output$: If a Javascript function has a return value, it is saved in this variable. If an error exists in the Javascript code, the Javascript error is saved in this variable.
      4. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • BindWebGadgetExJavaScript()
    • Syntax:
      Code:
      Result = BindWebGadgetExJavaScript(ID, PBProcedureName$, PBProcedureHandle, PID, @ErrorOutput$)

    • Beschreibung: Creates a link between PB procedure and Javascript. This makes it possible to execute a PB procedure from Javascript, including passing parameters.
    • Parameter:
      1. ID: The number of the created gadget.
      2. PBProcedureName$: The name of the procedure to be executed.
      3. PBProcedureHandle: The handle number of the procedure to be executed.
      4. PID: The PID number of your own program.
      5. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • GetWebGadgetExAttribute()
    • Syntax:
      Code:
      Result = GetWebGadgetExAttribute(ID, Attribute, @ErrorOutput$)

    • Description: Determines the value using the specified attribute.
    • Parameter:
      1. ID: The number of the created gadget.
      2. Attribute: One of the following attributes can be used:
        • #PB_Web_Busy: Checks if the page is still loading.
        • #PB_Web_Zoom: Determines the zoom value in percent.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value: Value using the specified attribute.
  • SetWebGadgetExAttribute()
    • Syntax:
      Code:
      Result = SetWebGadgetExAttribute(ID, Attribute, Value, @ErrorOutput$)

    • Description: Changes the value using the specified attribute.
    • Parameter:
      1. ID: The number of the created gadget.
      2. Attribute: One of the following attributes can be used:
        • #PB_Web_Zoom: Changes the zoom value in percent.
        • #PB_Web_BlockPopupMenu: Enables or disables the context menu.
      3. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • EnableRemoteDebugger()
    • Syntax:
      Code:
      Result = EnableRemoteDebugger(Port, @ErrorOutput$)

    • Description: This allows you to debug the opened page on another port with DevTools. It can only be enabled and used once per process before gadget creation. Example address for port 8088: http://localhost:8088/
    • Parameter:
      1. Port: Port number for debugging an open page. The port number must be between 1024 and 65535.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetWebGadgetExSetUserAgent()
    • Syntax:
      Code:
      Result = SetWebGadgetExSetUserAgent(UserAgent$, @ErrorOutput$)

    • Description: Changes the UserAgent string for the WebGadget. It can only be set once per process before gadget creation.
    • Parameter:
      1. UserAgent$: UserAgent
      2. @ErrorOutput$: If an error occurs, the error message is saved in the string variable.
    • Return value:
      • 1: The process was successful.
  • SetWebGadgetExProxy()
    • Syntax:
      Code:
      Result = SetWebGadgetExProxy(Proxy$, @ErrorOutput$)

    • Description: Changes the proxy server for the WebGadget. It can only be set once per process before gadget creation.
    • Parameter:
      1. Proxy$: Address and port number of the proxy server.
      2. @ErrorOutput$: If an error occurs, the error message is stored in the string variable.
    • Return value:
      • 1: The process was successful.

System requirements:
  • Windows Vista or higher
  • .NET Framework 4.5.2 or higher
  • Unicode activation (default from PB 5.50)

License: This DLL file is based on the component CefSharp and Chromium with version 71.0.3578.98 and is licensed as BSD.
The component is free and may be used both privately and commercially.
The following copyright texts must be included:
Quote:
Copyright © The CefSharp Authors. All rights reserved.
Copyright 2015 The Chromium Authors. All rights reserved.
Copyright © 2019 RSBasic.de

The framework CEF (Chromium Embedded Framework) is also used in many other products. E.G: GTA Online, Minecraft, Unity3D, Unreal Engine, Amazon Music, Facebook Messenger, ...

Download: http://www.rsbasic.de/downloads/downloa ... Gadget.zip
Image

I would be very pleased about feedbacks, improvement suggestions, error messages or wishes. If you want to support me, you can also donate me a little something. Thanks :)

PS: In the first version there is still a small bug in the gadget, which only occurs sometimes and it can happen that the position and size of the gadget is not right. If you also have this bug, please let me know.

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Wed Apr 24, 2019 7:27 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 534
Great!

Tried it and https://www.whatismybrowser.com/ says it's Chrome 71 on Windows 8 while my Chrome browser is up to date and says version 74 on Windows 10.
Nothing wrong here, so simply the dlls need to be exchanged?

As developer tools are "missing" (F12), I use full browser (Vivaldi for chromeless) and "background" local web server (s. a. postgres admin as an example).

But, JS/CSS3 are so powerful; this is a great "add-on" for PureBasic!

Thanks a lot!!!

(for this I waited for years now!)


Last edited by HanPBF on Wed Apr 24, 2019 7:42 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Wed Apr 24, 2019 7:36 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 534
Tried some more pages and could not "kill" Your source :D

Now, next question: how to communicate between browser and host?
At the moment, I use WebSocket from regular browser to background client and to be future proof when a web server is available...
WebSocket runs seemless overall.

Another, "more direct" way via string exchange?
Copy to clipboard is JS side available.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Thu Apr 25, 2019 2:12 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat May 05, 2007 5:31 pm
Posts: 629
Location: Linz, Austria
This is just... awesome!!! Thank you very much 8)


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Fri Apr 26, 2019 8:28 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
PB.Ex WebGadget 1.0.1.0 has been released.

Changelog:
  • Added: 32 bit support

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Fri Apr 26, 2019 9:00 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
PB.Ex WebGadget 1.0.2.0 has been released.

Changelog:
  • Added: DevTools


HanPBF wrote:
As developer tools are "missing"

I added that. You have to create the key event yourself.

HanPBF wrote:
Now, next question: how to communicate between browser and host?
At the moment, I use WebSocket from regular browser to background client and to be future proof when a web server is available...
WebSocket runs seemless overall.

I don't know yet if it's possible. I'll check later.

HanPBF wrote:
Another, "more direct" way via string exchange?
Copy to clipboard is JS side available.

What do you mean? What do you want to copy?

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Fri Apr 26, 2019 10:47 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 534
F12 -> developer tools; ok, will check what is shown; thanks a lot!

WebSocket -> no need to check, they will work!

Embedded browser and host program need to exchange data; sometimes it's done via status bar or executing JavaScript or maybe clipboard does work.
As mentioned, WebSocket will of course work also with embedded browser.
File exchange could work as Google Chrome supports the file writer API (https://caniuse.com/#feat=filesystem).

Again, great work! Thanks a lot!


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Fri Apr 26, 2019 9:44 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
PB.Ex WebGadget 1.0.3.0 has been released.

Changelog:
  • Added: ExecuteWebGadgetExJavaScript(): Executes any Javascript code.
  • Added: BindWebGadgetExJavaScript(): Creates a link between PB procedure and Javascript. This makes it possible to execute a PB procedure from Javascript, including passing parameters.

See example code in the first post.

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sat Apr 27, 2019 7:47 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
PB.Ex WebGadget 1.0.4.0 has been released.

Changelog:
  • Bugfix: BindWebGadgetExJavaScript(): Now also works on x86.

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sat Apr 27, 2019 9:31 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Feb 19, 2010 3:42 am
Posts: 534
Ok, I can not as fast check the new functions as You implement them -> so, slow down :D

Code:
Result = ExecuteWebGadgetExJavaScript(ID, Code$, @Output$, @ErrorOutput$)

-> output with result -> cooooool!!!

Code:
Result = BindWebGadgetExJavaScript(ID, PBProcedureName$, PBProcedureHandle, PID, @ErrorOutput$)

-> handle is address?
-> PID - process ID; found some solutions in the forum; for own exe easier to get?


You "just" bound PureBasic to another world!
Awesome!


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sat Apr 27, 2019 9:53 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
HanPBF wrote:
Code:
Result = BindWebGadgetExJavaScript(ID, PBProcedureName$, PBProcedureHandle, PID, @ErrorOutput$)

-> handle is address?
-> PID - process ID; found some solutions in the forum; for own exe easier to get?

In the first post you have an example code:
Code:
[...]
BindWebGadgetExJavaScript(1, "MyJSCallback", @MyJSCallback(), GetCurrentProcessId_(), @ErrorOutput$)
[...]


Handle is the memory address of your procedure. E.g.: @YourProcedure()
PID is the process ID of your application: GetCurrentProcessId_()

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sat Apr 27, 2019 2:59 pm 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
PB.Ex WebGadget 1.0.5.0 has been released.

Changelog:
  • Added: GetWebGadgetExAttribute(): #PB_Web_Busy can be used to check whether the page is still loading.
  • Bugfix: ExecuteWebGadgetExJavaScript()

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Sun Apr 28, 2019 10:07 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1593
Hi RSBasic,

I don't usually post outside of my own threads, but with all the incredible work you have provided the PureBasic community, I wanted to express my sincere respect.

The following is some information worth noting...

HTML5test:
PureBasic WebGadget: Your browser scores 312 out of 555 points
Microsoft Edge: Your browser scores 492 out of 555 points
PB.Ex WebGadget: Your browser scores 523 out of 555 points

Cheers :!:

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Mon Apr 29, 2019 8:14 am 
Offline
Moderator
Moderator
User avatar

Joined: Thu Dec 31, 2009 11:05 pm
Posts: 1106
Location: Germany::Berlin()
Thanks for the compliments and thanks for the HTML5 test. :)

_________________
ImageImageImageImage Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PB.Ex WebGadget (Windows) (WebKit)
PostPosted: Mon Apr 29, 2019 10:42 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Jun 06, 2003 2:41 pm
Posts: 177
Location: Belgium
This is really cool !

I was wondering if it would be easy to replace the current engine by https://ultralig.ht/.

The reason I ask this ...
Quote:
Ultra-light
Only 8MB compressed, low memory usage, we've stripped WebKit to the bare essentials.


Kind regards

_________________

LuckyLuke


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 55 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

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