Skip to content

Commit f05d65a

Browse files
Tofeecarewolf
authored andcommitted
adoptWebContents: re-bind user scripts with new adapter
Task-number: QTBUG-48984 Change-Id: I87cb224899458ba8f2d0343ed98932cfc8a6947f Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent eca92de commit f05d65a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/webengine/api/qquickwebengineview.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
573573
if (qmlWebChannel)
574574
adapter->setWebChannel(qmlWebChannel);
575575

576+
// re-bind the userscrips to the new adapter
577+
Q_FOREACH (QQuickWebEngineScript *script, m_userScripts)
578+
script->d_func()->bind(browserContextAdapter()->userScriptController(), adapter.data());
579+
576580
// Emit signals for values that might be different from the previous WebContentsAdapter.
577581
emit q->titleChanged();
578582
emit q->urlChanged();

0 commit comments

Comments
 (0)