Reference Codebot.WebKit.Controls.pas
Part of the Codebot WebKit package
The Codebot.WebKit.Controls unit gives you TWebBrowser, a web browser control that embeds WebKitGTK on Linux and Microsoft Edge WebView2 on Windows.
You can load a page by setting Location or calling Load, or show HTML of your own with LoadHtml. You can also stop and reload pages, move back and forward in the history, run JavaScript with ExecuteScript, zoom, make the page editable, print, capture the page to the clipboard, and show the developer tools. Changes you make before the control's window exists, such as setting Location, are kept and applied once the browser is ready.
Its events tell you about the location, title, progress, and status of a page as it loads, as well as errors, the element under the mouse, context menus, and the alert, confirm, and prompt dialogs of JavaScript. OnNavigate lets you allow or deny each navigation.
When the user downloads a file, it is saved to DownloadFolder, or to the user's download folder when that is empty. Each download is a TWebDownload in the Downloads list, and OnDownloadStart, OnDownloadProgress, and OnDownloadFinish let you follow it.
The unit also gives you TWebInspector, a control that shows the developer tools of a browser inside your form when its WebBrowser is set and Active is True.
The browser engine is loaded when your program runs rather than linked when it is built. If it is missing, the control shows a message instead of a page, and the TWebBrowser.Available class function returns False. At design time the controls show an icon and load nothing.
On Windows a few features differ. You can only move one step back or forward at a time, HistoryItem returns False, and ZoomTextOnly has no effect.
Items 168 items
| Name | Kind | Line |
|---|---|---|
| TCustomWebBrowser | class | 176 |
| ActiveDownloadFolder | function | 349 |
| AddListener | procedure | 357 |
| Available | function | 311 |
| BackOrForward | procedure | 331 |
| BackOrForwardExists | function | 333 |
| CancelDownload | procedure | 344 |
| CanGoBack | function | 327 |
| CanGoForward | function | 329 |
| CaptureToClipboard | procedure | 355 |
| ClearDownloads | procedure | 346 |
| CloseInspector | procedure | 337 |
| Create | constructor | 307 |
| Destroy | destructor | 308 |
| DestroyWnd | procedure | 242 |
| DoContextMenu | procedure | 266 |
| DoEnter | procedure | 250 |
| DoError | procedure | 259 |
| DoHitTest | procedure | 265 |
| DoLoadStatus | procedure | 258 |
| DoLocationChange | procedure | 262 |
| DoNavigate | procedure | 264 |
| DoProgress | procedure | 261 |
| DoScriptDialog | procedure | 268 |
| DoTitleChange | procedure | 263 |
| Download | procedure | 342 |
| ExecuteScript | procedure | 321 |
| GoBack | procedure | 323 |
| GoForward | procedure | 325 |
| HasView | function | 254 |
| HistoryItem | function | 340 |
| InitializeWnd | procedure | 241 |
| Load | procedure | 313 |
| LoadHtml | procedure | 315 |
| Notification | procedure | 243 |
| Paint | procedure | 245 |
| PaintWindow | procedure | 244 |
| procedure | 351 | |
| Reload | procedure | 319 |
| RemoveListener | procedure | 359 |
| Resize | procedure | 249 |
| ShowInspector | procedure | 335 |
| Stop | procedure | 317 |
| WSRegisterClass | procedure | 240 |
| ControlCanvas | property | 256 |
| DeveloperTools | property | 278 |
| DownloadCount | property | 367 |
| DownloadFolder | property | 281 |
| Downloads | property | 369 |
| Editable | property | 271 |
| HoverLink | property | 365 |
| Html | property | 373 |
| HtmlDefined | property | 375 |
| Inspector | property | 363 |
| Loading | property | 379 |
| LoadStatus | property | 377 |
| Location | property | 371 |
| OnContextMenu | property | 291 |
| OnDownloadFinish | property | 287 |
| OnDownloadProgress | property | 285 |
| OnDownloadStart | property | 283 |
| OnError | property | 289 |
| OnHitTest | property | 293 |
| OnLoadStatusChange | property | 295 |
| OnLocationChange | property | 297 |
| OnNavigate | property | 301 |
| OnProgress | property | 303 |
| OnScriptDialog | property | 305 |
| OnTitleChange | property | 299 |
| Progress | property | 381 |
| Title | property | 383 |
| ZoomFactor | property | 273 |
| ZoomTextOnly | property | 275 |
| TWebBrowser | class | 388 |
| Align | property | 390 |
| Anchors | property | 391 |
| BorderSpacing | property | 392 |
| Constraints | property | 393 |
| DeveloperTools | property | 402 |
| DownloadFolder | property | 403 |
| Editable | property | 396 |
| Enabled | property | 394 |
| Location | property | 395 |
| OnContextMenu | property | 407 |
| OnDownloadFinish | property | 406 |
| OnDownloadProgress | property | 405 |
| OnDownloadStart | property | 404 |
| OnError | property | 409 |
| OnHitTest | property | 410 |
| OnLoadStatusChange | property | 411 |
| OnLocationChange | property | 412 |
| OnNavigate | property | 414 |
| OnProgress | property | 415 |
| OnScriptDialog | property | 408 |
| OnTitleChange | property | 413 |
| TabOrder | property | 397 |
| TabStop | property | 398 |
| Visible | property | 399 |
| ZoomFactor | property | 400 |
| ZoomTextOnly | property | 401 |
| TWebContextMenuEvent | procedural | 95 |
| TWebDownload | class | 132 |
| ErrorMessage | property | 149 |
| FileName | property | 144 |
| Progress | property | 146 |
| Status | property | 147 |
| Uri | property | 142 |
| TWebDownloadEvent | procedural | 158 |
| TWebDownloadStartEvent | procedural | 155 |
| TWebDownloadStatus | enum | 122 |
| dsActive | enum value | 124 |
| dsFinished | enum value | 126 |
| dsFailed | enum value | 128 |
| TWebErrorEvent | procedural | 90 |
| TWebHitTest | set | 36 |
| TWebHitTestEvent | procedural | 99 |
| TWebHitTestItem | enum | 25 |
| htLink | enum value | 27 |
| htImage | enum value | 29 |
| htMedia | enum value | 31 |
| htSelection | enum value | 33 |
| htEditable | enum value | 35 |
| TWebInspector | class | 432 |
| Create | constructor | 460 |
| Destroy | destructor | 461 |
| DestroyWnd | procedure | 449 |
| InitializeWnd | procedure | 448 |
| Notification | procedure | 452 |
| Paint | procedure | 451 |
| PaintWindow | procedure | 450 |
| Resize | procedure | 455 |
| WSRegisterClass | procedure | 447 |
| Active | property | 464 |
| Align | property | 465 |
| Anchors | property | 466 |
| BorderSpacing | property | 467 |
| Constraints | property | 468 |
| ControlCanvas | property | 458 |
| Enabled | property | 469 |
| Visible | property | 470 |
| WebBrowser | property | 472 |
| TWebLoadStatus | enum | 44 |
| lsNone | enum value | 46 |
| lsStarted | enum value | 48 |
| lsRedirected | enum value | 50 |
| lsCommitted | enum value | 52 |
| lsFinished | enum value | 54 |
| lsFailed | enum value | 56 |
| TWebNavigateAction | enum | 38 |
| naAllow | enum value | 40 |
| naDeny | enum value | 42 |
| TWebNavigateEvent | procedural | 103 |
| TWebNotify | enum | 66 |
| wnReady | enum value | 68 |
| wnLocation | enum value | 70 |
| wnTitle | enum value | 72 |
| wnProgress | enum value | 74 |
| wnLoadStatus | enum value | 76 |
| wnHover | enum value | 78 |
| wnDownload | enum value | 80 |
| TWebNotifyEvent | procedural | 84 |
| TWebNotifyEvents | array | 85 |
| TWebProgressEvent | procedural | 106 |
| TWebScriptDialog | enum | 58 |
| sdAlert | enum value | 60 |
| sdConfirm | enum value | 62 |
| sdPrompt | enum value | 64 |
| TWebScriptDialogEvent | procedural | 110 |