WebEngineProfilePrototype QML Type

Creates an instance of QQuickWebEngineProfile class. More...

Import Statement: import QtWebEngine
Since: QtWebEngine 6.9

Properties

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

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:

ConstantDescription
WebEngineProfile.MemoryHttpCacheUses an in-memory cache. This is the only setting possible if offTheRecord is set or no storageName is available, which is the default.
WebEngineProfile.DiskHttpCacheUses a disk cache. This is the default value for non off-the-record profile with storageName.
WebEngineProfile.NoCacheDisables caching.

persistentCookiesPolicy : enumeration

This enumeration describes the policy of cookie persistence:

ConstantDescription
WebEngineProfile.NoPersistentCookiesBoth 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.AllowPersistentCookiesCookies 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.ForcePersistentCookiesBoth session and persistent cookies are saved to and restored from disk.

persistentPermissionsPolicy : enumeration

This enumeration describes the policy for permission persistence:

ConstantDescription
WebEngineProfile.AskEveryTimeThe 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.StoreInMemoryA 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.StoreOnDiskWorks 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.


© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.