Enables or disables formatting using internal Selection API commands vs. Chromium Commands.
Visual Basic |
---|
Public Property FormatUsingInternalSelectionAPI As Boolean |
The internal Selection API is a proprietary interface for the providing additional editing and formatting functionality to WebKitX control when used as HTML5 Editor. The API was designed in order to offer better control over Undo / Redo functionality and for consolidating formatting of subsequent elements.
Formatting with Selection API is experimental.
Private Sub WebKitX1_OnBrowserReady() On Error Resume Next ' Restore focus to WebKitX after a command is executed (form a menu or context menu) WebKitX1.ExecCommandSetFocus = True ' Enable mobileFX formatting vs. CEF3 formatting (Recommended) WebKitX1.FormatUsingInternalSelectionAPI = True ' Allow JavaScript download (sometimes scripts such as parallax mess with HTML5 styles) WebKitX1.DownloadScripts = False mnuDownloadScripts.Checked = False ' Initial HTML to show (optional) If LoadFile <> "" Then WebKitX1.Open LoadFile LoadFile = "" Else WebKitX1.HTML = "<html><body></body></html>" End If 'WebKitX1.Open "file:///my_path/index.html" End Sub
private void WebKitXCEF31_OnBrowserReady(object sender, EventArgs e) { WebKitXCEF31.ExecCommandSetFocus = true; WebKitXCEF31.FormatUsingInternalSelectionAPI = true; WebKitXCEF31.DownloadScripts = false; menuItemDownloadScript.Checked = false; if (LoadFile != "") { WebKitXCEF31.Open(LoadFile); LoadFile = ""; } else { WebKitXCEF31.HTML = "<html><body></body></html>"; } }