PureBasic WebGadget — Constants
PureBasic Constants (4)
#Cr_WebGadget_Enable_OnError_Support
- Data Type: Boolean
- Default: #True
- Procedure: Cr_WebGadget_OnError()
- Description: Procedure using the PureBasic OnErrorCall function.
#Cr_WebGadget_Enable_Resize_Support
- Data Type: Boolean
- Default: #False
- Procedure: Cr_WebGadget_Resize(gadget, x, y, width, height)
- Description: Procedure to resize both the ContainerGadget and WebGadget / WebViewGadget.
#Cr_WebGadget_Override_Profile_Location
- Data Type: Boolean
- Default: #False
- Location: GetUserDirectory(#PB_Directory_ProgramData)
- Description: Override the default profile location with the current directory.
#Cr_WebGadget_Override_Profile_Name
- Data Type: String
- Default: #Null$
- Name: CrWG_Default_Profile
- Description: Override the default profile name with a user-defined name.
Browser Constants (12)
Switch Reference: Chromium Command Line Switches
#Cr_WebGadget_Enable_AutoOpen_DevTools
- Data Type: Boolean
- Default: #False
- Switch: --auto-open-devtools-for-tabs
- Description: Makes Chrome auto-open DevTools window for each tab.
#Cr_WebGadget_Enable_Proxy_Auto_Detect
- Data Type: Boolean
- Default: #False
- Switch: --proxy-auto-detect
- Description: Forces proxy auto-detection.
#Cr_WebGadget_Enable_Proxy_Bypass_List
- Data Type: String
- Default: #Null$
- Switch: --proxy-bypass-list
- Description: Specifies hosts to bypass proxy. Ignored unless --proxy-server is also specified.
#Cr_WebGadget_Enable_Proxy_Server
- Data Type: String
- Default: #Null$
- Switch: --proxy-server
- Description: Uses specified proxy server, overriding system settings.
#Cr_WebGadget_Override_AutoPlay_Policy
- Data Type: Boolean
- Default: #False
- Switch: --autoplay-policy=no-user-gesture-required
- Description: Command line flag to set the autoplay policy.
#Cr_WebGadget_Override_Camera_Prompt
- Data Type: Boolean
- Default: #False
- Switch: --auto-accept-camera-and-microphone-capture
- Description: Overrides camera prompt, bypassing user permission dialog.
#Cr_WebGadget_Override_Language_Code
- Data Type: String
- Default: #Null$
- Switch: --lang
- Description: Override language code (ISO-639 format). Cannot be changed after profile creation.
#Cr_WebGadget_Override_Profile_Warning
- Data Type: Boolean
- Default: #False
- Switch: --no-network-profile-warning
- Description: Disables warning for profiles on network shares (Windows only).
#Cr_WebGadget_Override_Show_Scrollbars
- Data Type: Boolean
- Default: #False
- Switch: --hide-scrollbars
- Description: Prevents creation of scrollbars for web content.
#Cr_WebGadget_Override_User_Agent
- Data Type: Boolean
- Default: #False
- Switch: --user-agent
- Description: Overrides default user agent with a custom one.
#Cr_WebGadget_Override_Window_Position
- Data Type: String
- Default: #Null$
- Switch: --window-position
- Description: Sets initial window position (x,y).
#Cr_WebGadget_Override_Window_Size
- Data Type: String
- Default: #Null$
- Switch: --window-size
- Description: Sets initial window size (w,h).
WebSocket Constants (4)
#Cr_WebSocket_Enable_DevTools_Debugger
- Data Type: Boolean
- Default: #False
- Procedure: Multiple Procedures
- Description: Window displaying event data.
#Cr_WebSocket_Enable_DevTools_Events
- Data Type: Boolean
- Default: #False
- Procedure: Multiple Procedures
- Description: Used to receive event data from the browser.
#Cr_WebSocket_Enable_DevTools_Protocol
- Data Type: Boolean
- Default: #True
- Procedure: Multiple Procedures
- Description: Used to communicate with the browser.
#Cr_WebSocket_Override_Port_Number
- Data Type: Long
- Default: #Null
- Port Number: Random(9999, 9001)
- Description: Override to set a static port number.
Event Delay Constants (2)
Implements a modulus-based timing mechanism that introduces a periodic delay during idle time (#PB_NetworkEvent_None) between WebSocket events.
ModNumber is an iteration counter passed into the procedure.
ModDivisor determines the frequency of the delay by defining the modulus range.
ModNumber is incremented and wrapped using Mod(ModNumber + 1, ModDivisor).
- When the result equals
0, a delay of DelayMS milliseconds is applied; otherwise, no delay is introduced.
#CrWS_Event_Delay_Divisor
- Data Type: Long
- Default: 1000
- Procedure: ModDelay(ModNumber, ModDivisor, DelayMS)
- Description: Used in Procedure Cr_WebSocket_Event.
#CrWS_Event_Delay_MS
- Data Type: Long
- Default: 10
- Procedure: ModDelay(ModNumber, ModDivisor, DelayMS)
- Description: Used in Procedure Cr_WebSocket_Event.
Miscellaneous Constants (4)
Window Events
#CrWS_Event_DevTools_Connect
#CrWS_Event_DevTools_Disconnect
#CrWS_Event_DevTools_Callback
WebGadget Options
#CrWG_WebView_Gadget
#CrWG_WebView_Inspect
WebGadget Borders
#Cr_WebGadget_BorderLess
#Cr_WebGadget_Flat
#Cr_WebGadget_Raised
#Cr_WebGadget_Single
#Cr_WebGadget_Double
Data Types (Optional Parameters)
#CrWS_Array
#CrWS_Boolean
#CrWS_Integer
#CrWS_Number
#CrWS_Object
#CrWS_String