- Qt 6.10
- Qt WebEngine
- QML Types
- WebEngineProfilePrototype
- Qt 6.10.2 Reference Documentation

# WebEngineProfilePrototype QML Type

Creates an instance of QQuickWebEngineProfile class. More...

Import Statement: | `import QtWebEngine`
Since: | QtWebEngine 6.9

- List of all members, including inherited members

## Properties

- additionalTrustedCertificateFiles : list<string>
- cachePath : string
- httpCacheMaximumSize : int
- httpCacheType : enumeration
- persistentCookiesPolicy : enumeration
- persistentPermissionsPolicy : enumeration
- persistentStoragePath : string
- storageName : string

## Detailed Description

WebEngineProfile contains settings, scripts, and the list of visited links shared by all views that belong to the profile. Some of the profile's properties have to be initialized in one call and should not be modified during profile lifetime. WebEngineProfilePrototype provides way to create a profile, when all the required properties are set.

     // creating OTR profile
     WebEngineProfilePrototype: {
         id: otrProfile
     }
     let otrProfile = otrProfile.instance();

     // creating non-OTR profile
     WebEngineProfilePrototype: {
         id: nonOtrProfile
         storageName: 'Test'
     }
     let profile = nonOtrProfile.instance();

## Property Documentation

additionalTrustedCertificateFiles : list<string>

A list of paths of additional trusted certificates in this profile's CA certificate database.

The certificates are read when the profile is created; any invalid paths or certificate files are discarded. The property only holds the paths which were successfully loaded by this profile. This property expects the certificate files to be PEM-encoded.

cachePath : string

The path to the location where the profile's caches are stored, in particular the HTTP cache.

By default, the caches are stored below QStandardPaths::writableLocation(QStandardPaths::CacheLocation) in a directory named using storageName.

httpCacheMaximumSize : int

The maximum size of the HTTP cache. If `0`, the size will be controlled automatically by QtWebEngine. The default value is `0`.

See also WebEngineProfilePrototype::httpCacheType.

httpCacheType : enumeration

This enumeration describes the type of the HTTP cache:

Constant | Description
--- | ---
`WebEngineProfile.MemoryHttpCache` | Uses an in-memory cache. This is the only setting possible if offTheRecord is set or no storageName is available, which is the default.
`WebEngineProfile.DiskHttpCache` | Uses a disk cache. This is the default value for non off-the-record profile with storageName.
`WebEngineProfile.NoCache` | Disables caching.

persistentCookiesPolicy : enumeration

This enumeration describes the policy of cookie persistence:

Constant | Description
--- | ---
`WebEngineProfile.NoPersistentCookies` | Both session and persistent cookies are stored in memory. This is the only setting possible if offTheRecord is set or no storageName is available, which is the default.
`WebEngineProfile.AllowPersistentCookies` | Cookies marked persistent are saved to and restored from disk, whereas session cookies are only stored to disk for crash recovery. This is the default value for non off-the-record profile with storageName.
`WebEngineProfile.ForcePersistentCookies` | Both session and persistent cookies are saved to and restored from disk.

persistentPermissionsPolicy : enumeration

This enumeration describes the policy for permission persistence:

Constant | Description
--- | ---
`WebEngineProfile.AskEveryTime` | The application will ask for permissions every time they're needed, regardless of whether they've been granted before or not. This is intended for backwards compatibility with existing applications, and otherwise not recommended.

`WebEngineProfile.StoreInMemory`

A request will be made only the first time a permission is needed. Any subsequent requests will be automatically granted or denied, depending on the initial user choice. This carries over to all pages using the same QWebEngineProfile instance, until the application is shut down. This is the setting applied if `off-the-record` is set or no persistent data path is available.

`WebEngineProfile.StoreOnDisk` | Works the same way as `PersistentPermissionsInMemory`, but the permissions are saved to and restored from disk. This is the default setting.

persistentStoragePath : string

The path to the location where the persistent data for the browser and web content are stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links.

By default, the storage is located below QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) in a directory named using storageName.

storageName : string

The storage name that is used to create separate subdirectories for each profile that uses the disk for storing persistent data and cache. The storage name must be unique.

See also WebEngineProfilePrototype::persistentStoragePath and WebEngineProfilePrototype::cachePath.