summaryrefslogtreecommitdiff
path: root/indra/media_plugins/cef/media_plugin_cef.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2019-07-25 17:50:40 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2019-07-25 17:50:40 +0300
commite047bb09ba7958d82c302cc0e6dcf915e1f51fc9 (patch)
treecc42df45e7a6b6e8dcea5e21789e77bb8b606575 /indra/media_plugins/cef/media_plugin_cef.cpp
parent87be5f79975d0a3a5d6b7665aafc4be68b4f4afc (diff)
SL-10962 Support for suppressing JavaScript dialogs in the media plugin code
Diffstat (limited to 'indra/media_plugins/cef/media_plugin_cef.cpp')
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index c497a96cdc..1942b3d80c 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -72,6 +72,7 @@ private:
bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
void onCursorChangedCallback(dullahan::ECursorType type);
const std::vector<std::string> 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);
void postDebugMessage(const std::string& msg);
void authResponse(LLPluginMessage &message);
@@ -362,6 +363,14 @@ const std::vector<std::string> MediaPluginCEF::onFileDialog(dullahan::EFileDialo
////////////////////////////////////////////////////////////////////////////////
//
+bool MediaPluginCEF::onJSDialogCallback(const std::string origin_url, const std::string message_text, const std::string default_prompt_text)
+{
+ // return true indicates we suppress the JavaScript alert UI entirely
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type)
{
std::string name = "";
@@ -506,6 +515,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialog, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
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));
dullahan::dullahan_settings settings;
settings.accept_language_list = mHostLanguage;