# List of environment variables

WebKit uses several environment variables, most of which are designed for developers or debugging purposes. These variables should be used carefully, as they can impact the behavior of the software. These environment variables and their behavior are not guaranteed to remain stable across versions of WebKit. Always ensure that your WebKit version corresponds to the documentation you are referencing to avoid compatibility issues.

## Debugging Variables

- `WEBKIT_DEBUG` Defines a comma-separated list of logging channels and their levels for WebKit’s debugging output. Logging channels correspond to specific areas of functionality, such as networking, storage, and scrolling. For detailed usage, refer to WebKit’s Logging Guide.
  - Enabling a channel: Specify the channel’s name with an optional level (e.g., `Loading=warning` outputs warnings and errors for the Loading channel).
  - Disabling a channel: Prefix the name with a minus sign (`-`) (e.g., `all,-Network` enables all channels, except Network).
  - Enabling all channels: Use the wildcard `"all"` as the content of `WEBKIT_DEBUG`.
  - Child processes: The same configuration is shared to child processes spawned by the browser, like the `WebProcess` and `NetworkProcess`.
  - WebDriver-related channels: In addition to the browser, the WebDriver service executable also uses WebKit’s logging infrastructure, defining the following channels:
    - `WebDriverClassic` - For the HTTP-based WebDriver Classic prototol.
    - `WebDriverBiDi` - For the WebSockets-based WebDriver BiDi protocol.
    - `SessionHost` - For messages related to the management of the Browser under automation.

## Graphics-related variables

- `WEBKIT_SKIA_CPU_PAINTING_THREADS`: Specifies the amount of CPU worker threads to use for multi-threaded tile rendering using Skia. By default we use as much CPU worker threads as the amount of CPU cores in the system divided by two, capped at eight. Example: `2`

- `WEBKIT_SKIA_GPU_PAINTING_THREADS`: Specifies the amount of GPU worker threads to use for multi-threaded tile rendering using Skia. By default we use two GPU worker threads if the number of CPU cores in the system exceeds 3, otherwise we a single GPU worker thread. Example: `0` (don’t use GPU for tile rendering)

- `WEBKIT_SKIA_ENABLE_CPU_RENDERING`: Disallow the use of GPU for rendering purposes. If only setting `WEBKIT_SKIA_GPU_PAINTING_THREADS=0`, the GPU may still be used for e.g. accelerated filters (anything using accelerated ImageBuffers), even though the tile painting is performed using the CPU only. Example: `1`

- `WEBKIT_SKIA_USE_LINEAR_TILE_TEXTURES`: Force using a linear texture format for the tile textures — this allows to bypass OpenGL for texture updates, directly modifying dma-buf contents. This might degrade performance, depending on the capabilities of the GPU and display controller — use with care. However, if supported by the GPU/IPU combination, it can reduce the kernel load, reduce staging copies in Mesa, etc. Currently some devices out of the i.MX8 line might benefit.

## Remote Web Inspector Variables

- `WEBKIT_INSPECTOR_SERVER`: The address and port in `ip:port` format (e.g. `127.0.0.1:10000`) where the remote inspector service will listen for connections.
- `WEBKIT_INSPECTOR_HTTP_SERVER`: The address and port in `ip:port` format where the remote inspector service will listen for HTTP connections.

See Remote Web Inspector for more details.