Implement wxWebView::EnableAccessToDevTools() for GTK

This commit is contained in:
Tobias Taschner
2021-02-26 18:49:30 +01:00
parent 302ae644dd
commit 3af4702b11
3 changed files with 15 additions and 1 deletions

View File

@@ -78,6 +78,8 @@ public:
virtual wxString GetPageText() const wxOVERRIDE; virtual wxString GetPageText() const wxOVERRIDE;
virtual void Print() wxOVERRIDE; virtual void Print() wxOVERRIDE;
virtual bool IsBusy() const wxOVERRIDE; virtual bool IsBusy() const wxOVERRIDE;
virtual void EnableAccessToDevTools(bool enable = true) wxOVERRIDE;
virtual bool IsAccessToDevToolsEnabled() const wxOVERRIDE;
void SetZoomType(wxWebViewZoomType) wxOVERRIDE; void SetZoomType(wxWebViewZoomType) wxOVERRIDE;
wxWebViewZoomType GetZoomType() const wxOVERRIDE; wxWebViewZoomType GetZoomType() const wxOVERRIDE;

View File

@@ -776,7 +776,7 @@ public:
Enable or disable access to dev tools for the user. Enable or disable access to dev tools for the user.
This is currently only implemented for the Edge (Chromium) backend This is currently only implemented for the Edge (Chromium) backend
where the dev tools are enabled by default. where the dev tools are enabled by default and the WebKit2GTK+ backend.
@since 3.1.4 @since 3.1.4
*/ */

View File

@@ -698,6 +698,18 @@ float wxWebViewWebKit::GetWebkitZoom() const
return webkit_web_view_get_zoom_level(m_web_view); return webkit_web_view_get_zoom_level(m_web_view);
} }
void wxWebViewWebKit::EnableAccessToDevTools(bool enable)
{
WebKitSettings* settings = webkit_web_view_get_settings(m_web_view);
webkit_settings_set_enable_developer_extras(settings, enable);
}
bool wxWebViewWebKit::IsAccessToDevToolsEnabled() const
{
WebKitSettings* settings = webkit_web_view_get_settings(m_web_view);
return webkit_settings_get_enable_developer_extras(settings);
}
void wxWebViewWebKit::Stop() void wxWebViewWebKit::Stop()
{ {
webkit_web_view_stop_loading(m_web_view); webkit_web_view_stop_loading(m_web_view);