General Information

Locked
User avatar
JHPJHP
Site Admin
Posts: 217
Joined: Wed Jun 21, 2023 10:48 am

General Information

Post by JHPJHP »

Chromium Framework

Why use the Chromium Framework:
1. With the new PureBasic WebGadget, easily create full featured applications.
2. Use the included cross-platform WebSocket scripts to access the DevTools Protocol.
3. Most major browsers have adopted the CDP, fully accessible from the Chromium Framework.
4. The CDP can be used to control a WebGadget or any installed Chromium browser including Firefox.
5. The Chromium Framework supports App Mode and Headless Mode when applied to a Chromium browser.
6. Headless mode supports controlling any Chromium browser from a remote computer within the same subnet.
7. There are a wide variety of programs, examples and templates, from basic to advanced, to help get you started.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

CDP Standalone
Chromium
• Remote Command
• Remote Templates
Mozilla Firefox
• Remote Simple
• Remote Templates
PWA IIS ISAPI
• websites\remote-capture
• websites\remote-control

Custom WebGadget
CrWG Examples
CrWG Programs
CrWG Templates
Hosted Google Maps
Hosted Jam Systems
Library Bootstrap
Library ChartJS

PureBasic WebGadget
CrWG Examples
CrWG Templates
Hosted Google Maps
Hosted Jam Systems
Library Bootstrap
Library ChartJS

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

No external dependencies other then a supported browser
The Remote Command application should support any Chromium based browser.
• Tested: Edge, Chrome, Opera, Vivaldi, Brave, Epic, Maxthon and Comodo.
The Firefox application includes subtle differences as Mozilla only implemented a subset of the DevTools Protocol.
The Custom WebGadget currently supports Edge and Chrome, but other Chromium based browsers could be added.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

See the Chrome DevTools Protocol for available commands.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

• EventID is user-defined and can be any number.
• You can use the same number for every command.
• You can change the number when executing the same command multiple times.
• User-Event and Method-Event can be used to track when a command has completed.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Basic Example

Code: Select all

Enumeration
  #MainWindow
  #Cr_WebGadget
EndEnumeration

#Cr_WebSocket_Enable_DevTools_Protocol = #False

IncludeFile "../Shared Files/includes/sources.pbi"

WindowTitle$ = "Chromium WebGadget  " + Chr(9679) + "  Templates  " + Chr(9205) + "  Display Website"
WindowWidth = 1050 : WindowHeight = 700
nFlags = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_Invisible

If OpenWindow(#MainWindow, 0, 0, WindowWidth, WindowHeight, WindowTitle$, nFlags)
  Cr_WebGadget(#Cr_WebGadget, 0, 0, WindowWidth, WindowHeight, "https://start.duckduckgo.com")
  HideWindow(#MainWindow, #False)

  Repeat
    Event = WaitWindowEvent()

    Select Event
      Case #PB_Event_CloseWindow : Break
    EndSelect
  ForEver
EndIf
Navigate URL

Code: Select all

Page_Navigate(Connection, EventID, URL.s)
Execute JavaScript

Code: Select all

Runtime_Evaluate(Connection, EventID, Expression.s)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Thanks to STARGÅTE for the TabBarGadget; it was a lot easier adding browser like tabs to a Chromium Framework based application.

Code: Select all

;|-------------------------------------------------------------------------------------------------
;|
;|  Title            : TabBarGadget
;|  Version          : 1.5 Beta 2a (2019-03-25)
;|  Copyright        : UnionBytes
;|                     (Martin Guttmann alias STARGÅTE)
;|  PureBasic        : 5.20+
;|  String Format    : Ascii, Unicode
;|  Operating System : Windows, Linux, MacOS
;|  Processor        : x86, x64
;|
;|-------------------------------------------------------------------------------------------------
;|
;|  Description      : Gadget for displaying and using tabs like in the browser
;|
;|  Forum Topic      : https://www.purebasic.fr/german/viewtopic.php?f=8&t=24788
;|                     https://www.purebasic.fr/english/viewtopic.php?f=12&t=47588
;|  Website          : https://www.unionbytes.de/libs/tabbargadget/
;|
;|  Documentation    : https://help.unionbytes.de/tbg/
;|
;|-------------------------------------------------------------------------------------------------
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein
User avatar
JHPJHP
Site Admin
Posts: 217
Joined: Wed Jun 21, 2023 10:48 am

Re: General Information

Post by JHPJHP »

Image
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein
Locked