summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-02 12:58:22 -0400
committerLinus Groh <mail@linusgroh.de>2022-11-02 17:55:37 +0000
commitd60358580228d3387bd3631a62d4a4c22451cc6d (patch)
treece7622b6ad4fec5f22e576a7507687640058eec8 /Userland/Applications/Browser
parent819598aecf91a81e25aceba5ef512fd57d3252a6 (diff)
downloadserenity-d60358580228d3387bd3631a62d4a4c22451cc6d.zip
Browser+LibWebView: Add a Tab hook to take a screenshot
Diffstat (limited to 'Userland/Applications/Browser')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp4
-rw-r--r--Userland/Applications/Browser/Tab.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index e5b69d7d36..fea6bd164e 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -583,6 +583,10 @@ void BrowserWindow::create_new_tab(URL url, bool activate)
return active_tab().view().get_session_storage_entries();
};
+ new_tab.on_take_screenshot = [this]() {
+ return active_tab().view().take_screenshot();
+ };
+
new_tab.webdriver_endpoints().on_get_document_element = [this]() {
return active_tab().view().get_document_element();
};
diff --git a/Userland/Applications/Browser/Tab.h b/Userland/Applications/Browser/Tab.h
index cc2664879f..ba37fcd625 100644
--- a/Userland/Applications/Browser/Tab.h
+++ b/Userland/Applications/Browser/Tab.h
@@ -72,6 +72,7 @@ public:
Function<Vector<Web::Cookie::Cookie>()> on_get_cookies_entries;
Function<OrderedHashMap<String, String>()> on_get_local_storage_entries;
Function<OrderedHashMap<String, String>()> on_get_session_storage_entries;
+ Function<Gfx::ShareableBitmap()> on_take_screenshot;
WebDriverEndpoints& webdriver_endpoints() { return m_webdriver_endpoints; }