4D Blog

Home Product Custom Parameters for Initializing Embedded Web Area

Custom Parameters for Initializing Embedded Web Area

July 19, 2024

Product

Since the embedded web area utilizes CEF as its web browser engine, there have been requests for a method to incorporate additional CEF switches, like the autoplay-policy switch, during the area initialization. 

Starting with 4D 20 R6, you can manage your custom parameters using a parameter file.

The behavior and settings of the Chromium Embedded Framework (CEF) are modifiable using a command-line flags called CEF switches. To specify which switches to enable/disable during CEF initialization at 4D startup, you can add a new parameter file “4DCEFParameters.json”.

If you are in a development environment, you need to copy your parameter file to:

  • “C:\Users\xxxxxx\AppData\Roaming\4D\4DCEFParameters.json” on Windows
  • “$HOME/Library/Application Support/4D/4DCEFParameters.json” on macOS

and for the engine applications, you need to copy the file in the project resource folder.

The file must have the following structure:

{
   "switches":{
      "key":value
},
   "macOS":{
      "switches": {
         "key":value
      }
   },
   "windows": {
      "switches": {
         "key":value
      }
   }
}

With the macOS and Windows object, you can define switches to be used only on a specific platform.

For example, if you want to allow the auto play for sound or video that needs the “autoplay-policy=no-user-gesture-required” switch to be activated, just copy the following parameter file:


{
   "switches": {
      "autoplay-policy": "no-user-gesture-required",
   }
}

If you need to pass parameters that don’t need value, like the “enable-print-preview”  just use “true” as a value to enable it:

{
   "switches": {
      "autoplay-policy": "no-user-gesture-required",
      "enable-print-preview": true
   }
}

Warning: Keep in mind that the switches are applied for all the embedded areas used in 4D such as 4D View Pro. So it can apply the proper functioning of 4D or your applications. If you want to have an overview of the list of available switches, you can have a look at the list proposed by Peter Beverloo: List of Chromium Command Line Switches.

With 4D 20 R6, fine-tuning embedded web area switches becomes easy using a parameter file, “4DCEFParameters.json”. For ease of implementation, developers can refer to the provided documentation detailing the structure and usage of the parameter file.

Discuss

Tags 20 R6, 21, Web area

Latest related posts

  • October 23, 2025

    Starting Qodly studio is just two clicks away

  • October 22, 2025

    Localize your Qodly Pages: A Practical Guide

  • October 21, 2025

    New Way to Control Your HTTP Responses

Fabrice Mainguené
Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy