From c308c1cf5987fcca5614d472d3098d5075cbd678 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 18 May 2021 08:45:57 -0700 Subject: Pull in updated Dullahan and use it for for: Fix SL-14888 Media on a Prim should not show JS (about to unload) popups --- indra/media_plugins/cef/media_plugin_cef.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 181355d395..8c1855d5cb 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -73,6 +73,7 @@ private: void onCursorChangedCallback(dullahan::ECursorType type); const std::vector onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, const std::string dialog_accept_filter, bool& use_default); bool onJSDialogCallback(const std::string origin_url, const std::string message_text, const std::string default_prompt_text); + bool onJSBeforeUnloadCallback(); void postDebugMessage(const std::string& msg); void authResponse(LLPluginMessage &message); @@ -375,6 +376,14 @@ bool MediaPluginCEF::onJSDialogCallback(const std::string origin_url, const std: return true; } +//////////////////////////////////////////////////////////////////////////////// +// +bool MediaPluginCEF::onJSBeforeUnloadCallback() +{ + // return true indicates we suppress the JavaScript UI entirely + return true; +} + //////////////////////////////////////////////////////////////////////////////// // void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) @@ -523,6 +532,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1)); mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this)); mCEFLib->setOnJSDialogCallback(std::bind(&MediaPluginCEF::onJSDialogCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + mCEFLib->setOnJSBeforeUnloadCallback(std::bind(&MediaPluginCEF::onJSBeforeUnloadCallback, this)); dullahan::dullahan_settings settings; #if LL_WINDOWS -- cgit v1.2.3