show JS alerts in a better way
This commit is contained in:
parent
9c7f3c4b1c
commit
9952329e74
@ -52,7 +52,6 @@ class RSSGUARD_DLLSPEC WebEngineViewer : public QWebEngineView, public WebViewer
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ContextMenuData provideContextMenuData(QContextMenuEvent* event) const;
|
virtual ContextMenuData provideContextMenuData(QContextMenuEvent* event) const;
|
||||||
|
|
||||||
virtual QWebEngineView* createWindow(QWebEnginePage::WebWindowType type);
|
virtual QWebEngineView* createWindow(QWebEnginePage::WebWindowType type);
|
||||||
virtual void contextMenuEvent(QContextMenuEvent* event);
|
virtual void contextMenuEvent(QContextMenuEvent* event);
|
||||||
virtual bool event(QEvent* event);
|
virtual bool event(QEvent* event);
|
||||||
|
@ -71,6 +71,13 @@ void WebEnginePage::hideUnwantedElements() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WebEnginePage::javaScriptAlert(const QUrl& security_origin, const QString& msg) {
|
||||||
|
qApp
|
||||||
|
->showGuiMessage(Notification::Event::GeneralEvent,
|
||||||
|
GuiMessage(tr("Website alert"),
|
||||||
|
tr("URL %1 reports this important message: %2").arg(security_origin.toString(), msg)));
|
||||||
|
}
|
||||||
|
|
||||||
bool WebEnginePage::acceptNavigationRequest(const QUrl& url, NavigationType type, bool is_main_frame) {
|
bool WebEnginePage::acceptNavigationRequest(const QUrl& url, NavigationType type, bool is_main_frame) {
|
||||||
if (type == NavigationType::NavigationTypeLinkClicked) {
|
if (type == NavigationType::NavigationTypeLinkClicked) {
|
||||||
bool open_externally_now =
|
bool open_externally_now =
|
||||||
|
@ -25,6 +25,7 @@ class WebEnginePage : public QWebEnginePage {
|
|||||||
void hideUnwantedElements();
|
void hideUnwantedElements();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void javaScriptAlert(const QUrl& security_origin, const QString& msg);
|
||||||
virtual bool acceptNavigationRequest(const QUrl& url, NavigationType type, bool is_main_frame);
|
virtual bool acceptNavigationRequest(const QUrl& url, NavigationType type, bool is_main_frame);
|
||||||
virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level,
|
virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level,
|
||||||
const QString& message,
|
const QString& message,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user