mobileFX WebKitX CEF3 ActiveX 4.x
WebKitXCEF3Lib ActiveX Control / Settings Object / access_control_allow_origin Property
In This Topic
    access_control_allow_origin Property
    In This Topic
    Description

    Used with filter_response to overwrite CORS headers in HTTP response headers before passed to Browser.

    Property type
    Read-write property
    Syntax
    Visual Basic
    Public Property access_control_allow_origin As String
    Remarks

    For more information please read Content Filtering.

    Example
    Private Sub WebKitX1_OnCreate(ByVal Settings As WebKitXCEF3Lib.ISettings, CommandLineSwitches As String)
    
        On Error Resume Next
        
        WebKitX1.IPC_TIMEOUT_MILLIS = 5000
            
        ' Set the cache path
        Settings.cache_path = App.Path + "\MyCache"
        
        ' Set the application cache path
        Settings.application_cache = App.Path + "\MyAppCache"
        
        ' Enable cookies
        Settings.persist_session_cookies = 1
        
        ' Persistent user preferences
        Settings.persist_user_preferences = 1
        
        ' Enable plugins (eg. PDF viewer)
        Settings.plugins = True
        
        ' Enable flash plugin, place dll in same
        ' folder with ocx or provide explicit path
        'Settings.flash_player_dll_path = "pepflashplayer32_29_0_0_113.dll"
        
        ' Disable WebGL (used in VM/Citrix terminals for better performance)
        'Settings.webgl = False
        
        ' Disable context menu
        Settings.show_context_menu = True
        
        ' Additional switches, have a look here:
        ' https://peter.sh/experiments/chromium-command-line-switches/
        AddLog "CommandLineSwitches=" + CommandLineSwitches
        
        ' Enable HTML XML (but it really messes with local <script> elements
        'Settings.enable_xml_html = True
        
        '======================================================================
        ' Enabling content filtering is experimental and forces UTF-8 encoding
        ' https://bitbucket.org/chromiumembedded/cef/issues/1906/cef-ignores-content-type-charset-option
        '======================================================================
        
        ' Filter Response Headers
        Settings.filter_response = True
        
        ' Overwrite CORS
        Settings.access_control_allow_origin = "*"
        
        ' Remove Security Policy Headers
        Settings.remove_response_headers = "x-webkit-csp,content-security-policy,x-content-security-policy"
    
    End Sub
    See Also