Skip to content

Commit

Permalink
Add new enableDebugInspector option to display a popup inspector wind…
Browse files Browse the repository at this point in the history
…ow on supported platforms
  • Loading branch information
cesaref committed Oct 11, 2024
1 parent 387970d commit a8f948d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gui/choc_WebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class WebView
/// If supported, this enables developer features in the browser
bool enableDebugMode = false;

/// If supported, this pops up a separate debug inspector window
bool enableDebugInspector = false;

/// On OSX, setting this to true will allow the first click on a non-focused
/// webview to be used as input, rather than the default behaviour, which is
/// for the first click to give the webview focus but not trigger any action.
Expand Down Expand Up @@ -248,6 +251,12 @@ struct choc::ui::WebView::Pimpl
webkit_settings_set_enable_developer_extras (settings, true);
}

if (options.enableDebugInspector)
{
if (auto inspector = WEBKIT_WEB_INSPECTOR (webkit_web_view_get_inspector (WEBKIT_WEB_VIEW (webview))))
webkit_web_inspector_show (inspector);
}

if (! options.customUserAgent.empty())
webkit_settings_set_user_agent (settings, options.customUserAgent.c_str());

Expand Down

0 comments on commit a8f948d

Please sign in to comment.