diff options
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/WebViewStack.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp index 10aa6b8..9b7af78 100644 --- a/src/widgets/WebViewStack.cpp +++ b/src/widgets/WebViewStack.cpp @@ -4,8 +4,11 @@ #include <QWebEngineProfile> #include <cstdint> #include <cstdlib> +#include <memory> #include <vector> +#include "WindowActionRouter.hpp" +#include "events.hpp" #include "widgets/WebViewStack.hpp" static WebViewId next_webview_id = 1; @@ -49,6 +52,12 @@ WebView *WebViewStack::create_new_webview(const QUrl &url, bool focus) { connect(webview->page(), &QWebEnginePage::newWindowRequested, this, &WebViewStack::on_new_webview_request); + connect(webview->page(), &QWebEnginePage::urlChanged, this, + [webview](const QUrl &url) { + // TODO: Add window id + WindowActionRouter::instance().dispatch_event( + new UrlChangedEvent(url.toString(), webview->get_id(), 0)); + }); if (focus) focus_webview(webview->get_id()); |
