summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibWeb/HtmlView.cpp3
-rw-r--r--Libraries/LibWeb/HtmlView.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibWeb/HtmlView.cpp b/Libraries/LibWeb/HtmlView.cpp
index 57403b9a61..49bd81d61d 100644
--- a/Libraries/LibWeb/HtmlView.cpp
+++ b/Libraries/LibWeb/HtmlView.cpp
@@ -89,6 +89,9 @@ void HtmlView::set_document(Document* new_document)
main_frame().set_document(new_document);
+ if (on_set_document)
+ on_set_document(new_document);
+
if (new_document) {
new_document->on_layout_updated = [this] {
layout_and_sync_size();
diff --git a/Libraries/LibWeb/HtmlView.h b/Libraries/LibWeb/HtmlView.h
index 4804a12087..649535227e 100644
--- a/Libraries/LibWeb/HtmlView.h
+++ b/Libraries/LibWeb/HtmlView.h
@@ -65,6 +65,7 @@ public:
Function<void(const URL&)> on_load_start;
Function<void(const Gfx::Bitmap&)> on_favicon_change;
Function<void(const URL&)> on_url_drop;
+ Function<void(Document*)> on_set_document;
virtual bool accepts_focus() const override { return true; }