• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security, Resource Management, and Formatting Options
      • Base Actions
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
        • UI Action Invoker Namespace
        • UI.alert Action
        • UI.close Action
        • UI.enumerateWebViews Action
        • UI.getDisplayOptions Action
        • UI.getInputData Action
        • UI.getMaxDisplayDimensions Action
        • UI.postWebMessage Action
        • UI.setDisplayOptions Action
        • UI.setWebViewOptions Action
        • UI.showDialog Action
        • UI.view Action
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

UI.setWebViewOptions Action

Format
CS.UI.setWebViewOptions(ʃpermissions := ...ʅ)
ArgumentDescriptionTypes / Required
permissionsPrivileged resources allowed without requiring the user's consent.string, array
not required
Description
The UI.setWebViewOptions action sets options for the current web view, including granting permissions to use resources. The UI.setDisplayOptions action also can be used to customize display-related options of web views.
The permissions argument grants a web view access to a device resource without requiring user confirmation. It can be specified as a string specifying a single permission, or an array specifying multiple permissions. Once use of a resource is permitted, it cannot be revoked for that web view, and any subsequent setting of permissions will add to, not replace, the list of permitted resources. Permissions include:
  • "camera": Permission to capture photos or video using a camera.
  • "geolocation": Permission to access a device's geolocation using a GPS receiver or other location provider.
  • "microphone": Permission to capture audio using a microphone.
  • "web_storage": Permission to use the Web Storage API (localStorage and sessionStorage). This permission is only required on Android.
Return Value
The action returns undefined.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form.
Example (HTML + JavaScript)
<script>
    const CS = new CSProActionInvoker();

    CS.UI.setWebViewOptions({
        permissions: "geolocation"
    });

    navigator.geolocation.getCurrentPosition(onLocationSuccess, onLocationError);
</script>
See also: UI Action Invoker Namespace, UI.setDisplayOptions Action