PySide6.QtWebEngineCore.QWebEngineExtensionManager¶
- class QWebEngineExtensionManager¶
The
QWebEngineExtensionManagerclass allows applications to access Chrome/Firefox extension-compatible interfaces through managed packages.Details
QWebEngineExtensionManagerexposes interfaces compatible with the Chrome/Firefox extension platform, letting applications load or install packages built against that format at runtime.Loading via
loadExtension()is temporary and doesn’t persist across sessions, whileinstallExtension()stores the package in the profile directory so it loads automatically at startup.Loaded packages can be inspected through
extensions()property, which returns a list ofQWebEngineExtensionInfoobjects, and the manager emits signals when packages are loaded, installed, unloaded, or uninstalled. TheinstallPath()property indicates where installed packages are persisted.Only the ManifestV3 specification is supported — packages using other manifest versions are rejected outright. This capability is not available for off-the-record profiles. Every profile ships with two built-in components, Google Hangouts and the Chromium PDF Viewer, which can be disabled if not needed.
Note
If you use this API to develop a system that allows users to install extensions at runtime, you may fall under the CRA EN-304-617 rules on browser extensions.
Added in version 6.10.
Synopsis¶
Properties¶
extensionsᅟ- Returns a list of the loaded extensionsinstallPathᅟ- Returns the directory’s path where the extensions are installed
Methods¶
def
extensions()def
installPath()def
loadExtension()
Signals¶
def
loadFinished()def
unloadFinished()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Note
Properties can be used directly when
from __feature__ import true_propertyis used or via accessor functions otherwise.- property extensionsᅟ: list of QWebEngineExtensionInfo¶
This property holds Returns a list of the loaded extensions..
See also
- Access functions:
- property installPathᅟ: str¶
This property holds Returns the directory’s path where the extensions are installed..
See also
- Access functions:
- extensions()¶
- Return type:
.list of QWebEngineExtensionInfo
Getter of property
extensionsᅟ.- installExtension(path)¶
- Parameters:
path – str
Installs an extension from
pathto the profile’s directory and loads it.The
installFinished()signal is emitted after an extension is installed or the install failed. If the install succeededisInstalled()will returntrue, otherwiseerror()will contain information how the install process failed.Extensions are loaded in disabled state after the install succeeded. Installed extensions are automatically loaded at every startup in disabled state. The install path can be queried with
installPath().The installer is capable of installing zipped or unpacked extensions. The
pathparameter should point to a directory or a zip file containing the extension’s manifest file. If the manifest is missing from the top level directory, the install process will abort.Installing an already loaded or installed extension from the same path will install a new extension.
See also
- installFinished(extension)¶
- Parameters:
extension –
QWebEngineExtensionInfo
Signals that are emitted when
extensionis loaded, unloaded, installed, or uninstalled.- installPath()¶
- Return type:
str
Getter of property
installPathᅟ.- loadExtension(path)¶
- Parameters:
path – str
Loads an unpacked extension from
path.The
loadFinished()signal is emitted when an extension is loaded or the load failed. If the load succeededisLoaded()will returntrue, otherwiseerror()will contain information where the loading process failed.Extensions are always loaded in disabled state, users have to enable them manually. Loading an already loaded extension from the same path will reload the extension.
See also
- loadFinished(extension)¶
- Parameters:
extension –
QWebEngineExtensionInfo
Signals that are emitted when
extensionis loaded, unloaded, installed, or uninstalled.- setExtensionEnabled(extension, enabled)¶
- Parameters:
extension –
QWebEngineExtensionInfoenabled – bool
Allows to turn on/off the
extensionat runtime.The
enabledargument determines whether the extension should be enabled or disabled.- uninstallExtension(extension)¶
- Parameters:
extension –
QWebEngineExtensionInfo
Uninstalls the
extension.Removes the extension’s files from the install path and unloads the extension. The
uninstallFinished()signal is emitted after the process finished.See also
- uninstallFinished(extension)¶
- Parameters:
extension –
QWebEngineExtensionInfo
Signals that are emitted when
extensionis loaded, unloaded, installed, or uninstalled.- unloadExtension(extension)¶
- Parameters:
extension –
QWebEngineExtensionInfo
Unloads the
extensionRemoves all the extension’s data from memory.
The
unloadFinished()signal is emitted after the unload process finished.Note
It is also possible to unload internal extensions like Hangouts and PDF, but they will be loaded at next startup like other installed extensions.
See also
- unloadFinished(extension)¶
- Parameters:
extension –
QWebEngineExtensionInfo
Signals that are emitted when
extensionis loaded, unloaded, installed, or uninstalled.