mobileFX WebKitX CEF3 ActiveX 4.x
WebKitXCEF3Lib ActiveX Control / WebKitXCEF3 Object / Edit Method
In This Topic
    Edit Method
    In This Topic
    Description

    Enables HTML5 Editor.

    Syntax
    Visual Basic
    Public Sub Edit() 
    Remarks

    There are some best practices when using WebKitX as an HTML5 Editor: 

    Disabling JavaScript download

    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.

     

    Detecting Edit Mode from JavaScript

    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:

     

    Example
    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();
        }
    }
    See Also