1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

Browser: Add a context menu item to take a screenshot of the current tab

This commit is contained in:
Timothy Flynn 2022-11-02 14:11:40 -04:00 committed by Linus Groh
parent 43888b848c
commit ce8c34a8c9
3 changed files with 37 additions and 0 deletions

View file

@ -404,6 +404,8 @@ Tab::Tab(BrowserWindow& window)
m_page_context_menu->add_action(window.view_source_action());
m_page_context_menu->add_action(window.inspect_dom_tree_action());
m_page_context_menu->add_action(window.inspect_dom_node_action());
m_page_context_menu->add_separator();
m_page_context_menu->add_action(window.take_screenshot_action());
view().on_context_menu_request = [&](auto& screen_position) {
m_page_context_menu->popup(screen_position);
};