QWebEngineScriptCollection

The QWebEngineScriptCollection class represents a collection of user scripts. More

Inheritance diagram of PySide2.QtWebEngineWidgets.QWebEngineScriptCollection

Synopsis

Functions

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 PySide2.QtWebEngineWidgets.QWebEngineScriptCollection
PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.clear()

Removes all scripts from this collection.

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.contains(value)
Parameters

valuePySide2.QtWebEngineWidgets.QWebEngineScript

Return type

bool

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

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.count()
Return type

int

Returns the number of elements in the collection.

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.findScript(name)
Parameters

name – str

Return type

PySide2.QtWebEngineWidgets.QWebEngineScript

Returns the first script found in the collection with the name name , or a null QWebEngineScript if none was found.

Note

The order in which the script collection is traversed is undefined, which means this should be used when the unicity is guaranteed at the application level.

See also

findScripts()

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.findScripts(name)
Parameters

name – str

Return type

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

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.insert(list)
Parameters

list

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.insert(arg__1)
Parameters

arg__1PySide2.QtWebEngineWidgets.QWebEngineScript

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.isEmpty()
Return type

bool

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

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.remove(arg__1)
Parameters

arg__1PySide2.QtWebEngineWidgets.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 .

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.size()
Return type

int

Returns the number of elements in the collection.

PySide2.QtWebEngineWidgets.QWebEngineScriptCollection.toList()
Return type

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