class QCefContext
class QCefContext
: public QObject
Represents the CEF context.
Summary
Members | Descriptions |
---|---|
public QCefContext (QCoreApplication * app, int argc, char ** argv, const QCefConfig * config) | Constructs the CEF context. |
public ~QCefContext () | Destructs the CEF context. |
public void addLocalFolderResource (const QString & path, const QString & url, int priority) | Adds a url mapping item with local web resource directory. This works for all instances created subsequently. |
public void addArchiveResource (const QString & path, const QString & url, const QString & password, int priority) | Adds a url mapping item with local archive (.zip) file which contains the web resource. This works for all instances created subsequently. |
public bool addCookie (const QString & name, const QString & value, const QString & domain, const QString & url) | Adds a cookie to the CEF context, this cookie is accessible from all browsers created with this context. |
public bool deleteAllCookies () | Deletes all cookies from the CEF context. |
public bool addCrossOriginWhitelistEntry (const QString & sourceOrigin, const QString & targetSchema, const QString & targetDomain, bool allowTargetSubdomains) | Adds an entry to the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L81C23-L81C23. |
public bool removeCrossOriginWhitelistEntry (const QString & sourceOrigin, const QString & targetSchema, const QString & targetDomain, bool allowTargetSubdomains) | Removes an entry from the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L91C12-L91C12. |
public bool clearCrossOriginWhitelistEntry () | Removes all entries from the cross-origin access whitelist. |
public const QCefConfig * cefConfig () const | Gets the QCefConfig. |
protected bool init (const QCefConfig * config) | Initialize the CEF context. |
protected void uninit () | Uninitialize the CEF context. |
private QScopedPointer< QCefContextPrivate > d_ptr | |
public static QCefContext * instance () | Gets the unique default instance. |
Members
public
QCefContext
(QCoreApplication * app, int argc, char ** argv, const
QCefConfig
* config)
Constructs the CEF context.
Parameters
app
The applicationargc
The argument countargv
The argument list pointerconfig
The QCefConfig instance
public
~QCefContext
()
Destructs the CEF context.
public void
addLocalFolderResource
(const QString & path, const QString & url, int priority)
Adds a url mapping item with local web resource directory. This works for all instances created subsequently.
Parameters
path
The path to the local resource directoryurl
The url to be mapped topriority
The priority
public void
addArchiveResource
(const QString & path, const QString & url, const QString & password, int priority)
Adds a url mapping item with local archive (.zip) file which contains the web resource. This works for all instances created subsequently.
Parameters
path
The path to the local archive fileurl
The url to be mapped topassword
The password of the archivepriority
The priority
public bool
addCookie
(const QString & name, const QString & value, const QString & domain, const QString & url)
Adds a cookie to the CEF context, this cookie is accessible from all browsers created with this context.
Parameters
name
The cookie item namevalue
The cookie item valuedomain
The applicable domain nameurl
The applicable url
Returns
True on success; otherwise false
public bool
deleteAllCookies
()
Deletes all cookies from the CEF context.
Returns
True on success; otherwise false
public bool
addCrossOriginWhitelistEntry
(const QString & sourceOrigin, const QString & targetSchema, const QString & targetDomain, bool allowTargetSubdomains)
Adds an entry to the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L81C23-L81C23.
Parameters
sourceOrigin
The source origintargetSchema
The target schematargetDomain
The target domainallowTargetSubdomains
Whether to allow subdomain or not
Returns
True on success; otherwise false
public bool
removeCrossOriginWhitelistEntry
(const QString & sourceOrigin, const QString & targetSchema, const QString & targetDomain, bool allowTargetSubdomains)
Removes an entry from the cross-origin access whitelist. For details please refer to: https://github.com/chromiumembedded/cef/blob/605c2bac86415dcec1e2902cdc46dc11c1ad026a/include/cef_origin_whitelist.h#L91C12-L91C12.
Parameters
sourceOrigin
The source origintargetSchema
The target schematargetDomain
The target domainallowTargetSubdomains
Whether to allow subdomain or not
Returns
True on success; otherwise false
public bool
clearCrossOriginWhitelistEntry
()
Removes all entries from the cross-origin access whitelist.
public const
QCefConfig
*
cefConfig
() const
Gets the QCefConfig.
Returns
The QCefConfig instance
protected bool
init
(const
QCefConfig
* config)
Initialize the CEF context.
Parameters
config
The QCefConfig instance
Returns
True on success; otherwise false
protected void
uninit
()
Uninitialize the CEF context.
private QScopedPointer< QCefContextPrivate >
d_ptr
public static
QCefContext
*
instance
()
Gets the unique default instance.
Returns
The default instance