Messagelib
7 #include "webenginemanagescript.h"
8 #include "webengineviewer_debug.h"
10 #include <QWebEngineProfile>
11 #include <QWebEngineScript>
12 #include <QWebEngineScriptCollection>
14 using namespace WebEngineViewer;
16 WebEngineManageScript::WebEngineManageScript(
QObject *parent)
21 WebEngineManageScript::~WebEngineManageScript() =
default;
23 void WebEngineManageScript::addScript(QWebEngineProfile *profile,
26 QWebEngineScript::InjectionPoint injectionPoint)
29 QWebEngineScript script;
31 if (!collectionScripts.
isEmpty()) {
32 script = collectionScripts.
first();
34 for (
const QWebEngineScript &s : collectionScripts) {
35 profile->scripts()->remove(s);
39 script.setName(scriptName);
40 script.setInjectionPoint(injectionPoint);
41 script.setRunsOnSubFrames(
true);
42 script.setWorldId(scriptWordId());
44 script.setSourceCode(source);
45 profile->scripts()->
insert(script);
bool isNull() const const
bool isEmpty() const const
QString & insert(int position, QChar ch)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed May 25 2022 03:55:41 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.