WebKit2.WebContext.prototype.set_process_model

function set_process_model(process_model: WebKit2.ProcessModel): void {
    // Gjs wrapper for webkit_web_context_set_process_model()
}
  

Specifies a process model for WebViews, which WebKit will use to determine how auxiliary processes are handled. The default setting (WebKit2.ProcessModel.shared_secondary_process) is suitable for most applications which embed a small amount of WebViews, or are used to display documents which are considered safe — like local files.

Applications which may potentially use a large amount of WebViews —for example a multi-tabbed web browser— may want to use WebKit2.ProcessModel.multiple_secondary_processes, which will use one process per view most of the time, while still allowing for web views to share a process when needed (for example when different views interact with each other). Using this model, when a process hangs or crashes, only the WebViews using it stop working, while the rest of the WebViews in the application will still function normally.

This method **must be called before any web process has been created**, as early as possible in your application. Calling it later will make your application crash.

Since 2.4

process_model

a WebKit2.ProcessModel