diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-06 20:01:46 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-06 20:02:30 +0200 |
commit | 32243e1df24820b8da8bcf5bc491cd812d261483 (patch) | |
tree | e4e496d26f2c7544b343065448347ec933521264 /Demos/WebView/main.cpp | |
parent | fd65a2483492dfd50cae61b613d9bd8ed95306b3 (diff) | |
download | serenity-32243e1df24820b8da8bcf5bc491cd812d261483.zip |
WebContent: Plumb link clicks to the WebContentView :^)
You can now react to links being clicked via the on_link_click hook.
Diffstat (limited to 'Demos/WebView/main.cpp')
-rw-r--r-- | Demos/WebView/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Demos/WebView/main.cpp b/Demos/WebView/main.cpp index 3d6446bb98..4fe29c725f 100644 --- a/Demos/WebView/main.cpp +++ b/Demos/WebView/main.cpp @@ -56,6 +56,11 @@ int main(int argc, char** argv) statusbar.set_text(""); }; + view.on_link_click = [&](auto& url, auto&, auto) { + if (url.is_valid()) + view.load(url); + }; + view.load("file:///res/html/misc/welcome.html"); return app->exec(); |