以QCefViewTest工程为例,需要在CefViewWidget类中重载onBeforePopup方法
bool CefViewWidget::onBeforePopup(qint64 frameId,
const QString& targetUrl,
const QString& targetFrameName,
QCefView::CefWindowOpenDisposition targetDisposition,
QCefSetting& settings,
bool& DisableJavascriptAccess)
{
QCefView::navigateToUrl(targetUrl);
return true;
}
参考:https://www.cnblogs.com/tingtaishou/p/14760845.html