Description
WebChannel is not initialized when adding it in QWebEngineScript::ApplicationWorld and disabling javascript in QWebEngineScript::MainWorld (error message "Uncaught ReferenceError: qt is not defined"). WebChannelIPCTransport::DidClearWindowObject which contains WebChannelTransport::Install in qtwebengine/src/core/renderer/web_channel_ipc_transport.cpp is never called.
We tried overriding content::RenderFrameObserver::DidCreateScriptContext in WebChannelIPCTransport and call WebChannelTransport::Install there and it seems to fix the problem (m_canUseContext is set to false in WebChannelIPCTransport::WillReleaseScriptContext)
Attachments
For Gerrit Dashboard: QTBUG-88875 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
371756,4 | Fix WebChannel when JavaScript is disabled | dev | qt/qtwebengine | Status: MERGED | +2 | 0 |
373299,2 | Fix WebChannel when JavaScript is disabled | 6.2 | qt/qtwebengine | Status: MERGED | +2 | 0 |