Custom Chromium Flags
CustomChromiumFlags is a sandbox setting in Sandboxie Ini available since v1.14.2 / 5.69.2. This setting allows you to pass additional command line flags to Chromium-based browsers when they are launched within the sandbox. Sandboxie automatically injects these flags into the browser's startup command line, enabling fine-tuned control over browser behavior for enhanced compatibility and functionality within the sandboxed environment.
Usage
Syntax
Technical Details
When CustomChromiumFlags
is configured, Sandboxie modifies the command line of applications identified as Chromium-based browsers during process initialization:
-
Browser Detection: The setting applies only to applications classified as Chrome through the
SpecialImage
configuration or automatic detection4. -
Command Line Injection: During kernel initialization, Sandboxie intercepts the process parameters and reconstructs the command line by inserting the custom flags5 between the executable path and existing arguments6.
-
Child Process Filtering: The flags are only added to main browser processes, not to child processes that contain the
--type=
parameter, preventing duplication and potential conflicts7.
Default Configuration
Sandboxie includes a default value to ensure browser compatibility:
This default flag disables the Print Compositor LPAC (Low Privilege App Container) feature which can cause compatibility issues in sandboxed environments1.
Usage Examples
-
Basic GPU Acceleration Disable:
-
Multiple Performance Flags:
-
Debugging Options:
Security Implications
- Browser Compatibility: The default
PrintCompositorLPAC
flag prevents printing-related crashes and ensures stable browser operation within sandboxes - Flag Validation: Users should carefully validate custom flags as some may compromise sandbox security or browser stability
- Automatic Application: The setting automatically applies to all applications defined as Chrome browsers, whether configured manually or detected automatically
Implementation Notes
The setting is processed during DLL initialization when Sandboxie detects a Chromium-based browser. The system:
- Queries the configuration using
SbieApi_QueryConfAsIs
with the keyCustomChromiumFlags
2 - Allocates additional memory for the expanded command line to accommodate the custom flags
- Reconstructs the command line by copying the executable path, inserting the custom flags, and appending remaining arguments3
- Hooks the
GetCommandLineW
andGetCommandLineA
functions to return the modified command line to the application
Browser Support
This setting works with all Chromium-based browsers, including: - Google Chrome - Microsoft Edge (Chromium) - Brave Browser - Opera - Vivaldi - Any other browser built on the Chromium engine
Related Settings
- SpecialImage - Used to classify applications as Chromium browsers
Related Sandboxie Plus setting: Not directly exposed in UI (uses default value automatically)
-
Default configuration in
Templates.ini
: The default--disable-features=PrintCompositorLPAC
flag prevents Low Privilege App Container printing issues that can cause browser instability in sandboxed environments. ↩ -
Configuration query in
kernel.c
:SbieApi_QueryConfAsIs(NULL, L"CustomChromiumFlags", 0, CustomChromiumFlags, ARRAYSIZE(CustomChromiumFlags))
retrieves the setting value during kernel initialization. ↩ -
Command line modification in
kernel.c
: The system copies the original executable path, appends the custom flags with proper spacing, and concatenates the remaining arguments to create the modified command line. ↩ -
Browser detection in
dllmain.c
: Applications are classified asDLL_IMAGE_GOOGLE_CHROME
through theSpecialImage
configuration system, which maps browser executables to the Chrome image type for specialized handling. ↩ -
List of Chromium Command Line Switches -
https://peter.sh/experiments/chromium-command-line-switches/
↩ -
Command line reconstruction in
kernel.c
: The system callsSbieDll_FindArgumentEnd
to locate the boundary between the executable path and arguments, then allocates expanded memory and reconstructs the command line with injected flags. ↩ -
Child process filtering in
kernel.c
: The condition!wcsstr(ProcessParms->CommandLine.Buffer, L" --type=")
ensures that only main browser processes receive the custom flags, excluding renderer and utility processes. ↩