-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcef_view_widget.cpp
35 lines (29 loc) · 1.06 KB
/
cef_view_widget.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "cef_view_widget.h"
#include <QColor>
#include <QPainterPath>
#include <QRandomGenerator>
#include <QResizeEvent>
#include <QWindow>
#include <QDebug>
#include <QUrl>
#include <QDesktopServices>
CefViewWidget::CefViewWidget(const QString url,
const QCefSetting* setting,
QWidget* parent /* = 0*/)
: QCefView(url, setting, parent) {}
CefViewWidget::~CefViewWidget() {}
bool CefViewWidget::onBeforePopup(qint64 frameId,
const QString& targetUrl,
const QString& targetFrameName,
QCefView::CefWindowOpenDisposition targetDisposition,
QCefSetting& settings,
bool& DisableJavascriptAccess) {
if (targetUrl.startsWith("https://www.bing.com/rewards/authcheck")) {
this->navigateToUrl(targetUrl);
return true;
}
QUrl target(targetUrl);
QDesktopServices::openUrl(target);
// return false to allow the popup browser
return true;
}