diff --git a/panel/browser-panel-client.cpp b/panel/browser-panel-client.cpp index 7523faf2b..f5d5a3040 100644 --- a/panel/browser-panel-client.cpp +++ b/panel/browser-panel-client.cpp @@ -405,6 +405,12 @@ void QCefBrowserClient::OnLoadEnd(CefRefPtr, frame->ExecuteJavaScript(widget->script, CefString(), 0); else if (!script.empty()) frame->ExecuteJavaScript(script, CefString(), 0); + + std::string script2 = "window.close = () => "; + script2 += "console.log("; + script2 += "'OBS browser docks cannot be closed using JavaScript.'"; + script2 += ");"; + frame->ExecuteJavaScript(script2, "", 0); } bool QCefBrowserClient::OnJSDialog(CefRefPtr, const CefString &,