diff --git a/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs b/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs index f98ce1bd1..555bb1d24 100644 --- a/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs +++ b/CefSharp/Internals/Partial/ChromiumWebBrowser.Partial.cs @@ -499,7 +499,7 @@ namespace CefSharp.WinForms ResourceRequestHandlerFactory = null; RenderProcessMessageHandler = null; - this.DisposeDevToolsContext(); + this.FreeDevToolsContext(); } /// diff --git a/CefSharp/WebBrowserExtensions.cs b/CefSharp/WebBrowserExtensions.cs index 18655551a..243ee88c4 100644 --- a/CefSharp/WebBrowserExtensions.cs +++ b/CefSharp/WebBrowserExtensions.cs @@ -1796,7 +1796,7 @@ namespace CefSharp } /// - /// Dispose of the DevTools Context (if any). Used in conjunction with CefSharp.Puppeteer + /// Dispose of the DevToolsContext (if any). Used in conjunction with CefSharp.Dom /// /// ChromiumWebBrowser instance public static void DisposeDevToolsContext(this IWebBrowserInternal webBrowserInternal) @@ -1810,6 +1810,20 @@ namespace CefSharp webBrowserInternal.DevToolsContext = null; } + /// + /// Set the property to null. Used in conjunction with CefSharp.Dom + /// + /// ChromiumWebBrowser instance + public static void FreeDevToolsContext(this IWebBrowserInternal webBrowserInternal) + { + if (webBrowserInternal == null) + { + return; + } + + webBrowserInternal.DevToolsContext = null; + } + /// /// Function used to encode the params passed to , /// and