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

Browser: Add "Inspect Element" to context menu :^)

This opens the DOM Inspector window, with the target element already
selected. (If the window is already open, it just selects the element.)

Note that this only applies to single-process mode for now. In OOP mode,
the "inspect element" action is disabled.
This commit is contained in:
Sam Atkins 2021-08-17 17:00:27 +01:00 committed by Andreas Kling
parent 8eef509c1b
commit 37f060b873
6 changed files with 69 additions and 19 deletions

View file

@ -64,6 +64,12 @@ public:
Function<void(const URL&, const Web::Cookie::ParsedCookie& cookie, Web::Cookie::Source source)> on_set_cookie;
Function<void()> on_dump_cookies;
enum class InspectorTarget {
Document,
HoveredElement
};
void show_inspector_window(InspectorTarget);
const String& title() const { return m_title; }
const Gfx::Bitmap* icon() const { return m_icon; }