Enables HTML5 Editor.
Enables HTML5 Editor.
Visual Basic |
---|
Public Sub Edit() |
There are some best practices when using WebKitX as an HTML5 Editor:
Disabling scripts downloading is advisable when using WebKitX as an Editor because JavaScript execution often messes with HTML5 styles, especially if you are using features such as Parallax Scrolling and JavaScript-aided responsive layouts.
There are cases where your JavaScript code might need to detect if WebKitX is in Edit mode. To do that simply read window.__WEBKITX_EDITABLE__ variable. You should wrap Google Analytics and Google Tags Manager initialization code inside a conditional block and download Google scripts (or any other script) by URL, as illustrated below:
Private Sub WebKitX1_OnLoadEnd() On Error Resume Next AddLog "WebKitX1_OnLoadEnd: " + WebKitX1.URL ' Control Edit or Preview If mnuEditable.Checked Then WebKitX1.Edit WebKitX1.Modified = False Else WebKitX1.Preview End If End Sub
private void WebKitXCEF31_OnLoadEnd(object sender, EventArgs e) { AddLog("WebKitX1_OnLoadEnd: " + WebKitXCEF31.URL); if (menuItemEnableHTMLEditing.Checked) { WebKitXCEF31.Edit(); WebKitXCEF31.Modified = false; } else { WebKitXCEF31.Preview(); } }