QWebEngineScriptCollection#

The QWebEngineScriptCollection class represents a collection of user scripts. More

Synopsis#

Functions#

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

Detailed Description#

QWebEngineScriptCollection manages a set of user scripts.

Use scripts() and scripts() to access the collection of scripts associated with a single page or a number of pages sharing the same profile.

See also

Script Injection

class PySide6.QtWebEngineCore.QWebEngineScriptCollection#
PySide6.QtWebEngineCore.QWebEngineScriptCollection.clear()#

Removes all scripts from this collection.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.contains(value)#
Parameters:

valuePySide6.QtWebEngineCore.QWebEngineScript

Return type:

bool

Returns true if the collection contains an occurrence of value; otherwise returns false.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.count()#
Return type:

int

Returns the number of elements in the collection.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.find(name)#
Parameters:

name – str

Return type:

.list of QWebEngineScript

Returns the list of scripts in the collection with the name name, or an empty list if none was found.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.insert(list)#
Parameters:

list – .list of QWebEngineScript

Inserts scripts from the list list into the collection.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.insert(arg__1)
Parameters:

arg__1PySide6.QtWebEngineCore.QWebEngineScript

Inserts the script s into the collection.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.isEmpty()#
Return type:

bool

Returns true if the collection is empty; otherwise returns false.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.remove(arg__1)#
Parameters:

arg__1PySide6.QtWebEngineCore.QWebEngineScript

Return type:

bool

Removes script from the collection.

Returns true if the script was found and successfully removed from the collection; otherwise returns false.

PySide6.QtWebEngineCore.QWebEngineScriptCollection.toList()#
Return type:

.list of QWebEngineScript

Returns a list with the values of the scripts used in this collection.