summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-15 21:16:26 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-15 21:16:47 +0200
commit7c1cd47772ac7a19534770d6e7479f6e907a181c (patch)
treecb5b5a38cad8f90bca4f0770c0048cca4d1e35a3 /indra/newview/llviewermedia.cpp
parentac54b72974f3d00d0e02fdc5aec86f1e632df76d (diff)
parent0a873cd95547f003878c6d00d0883ff792f4a865 (diff)
Merge branch 'master' (DRTVWR-552) into DRTVWR-527-maint
# Conflicts: # indra/media_plugins/cef/media_plugin_cef.cpp - setOnLoadEndCallback # indra/newview/llviewerassetstorage.cpp - mAssetCoroCount
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 959443429d..c99fccc3c6 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1752,8 +1752,16 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
media_source->cookies_enabled( cookies_enabled || clean_browser);
// collect 'javascript enabled' setting from prefs and send to embedded browser
- bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" );
- media_source->setJavascriptEnabled( javascript_enabled || clean_browser);
+ bool javascript_enabled = gSavedSettings.getBOOL("BrowserJavascriptEnabled");
+ media_source->setJavascriptEnabled(javascript_enabled || clean_browser);
+
+ // collect 'web security disabled' (see Chrome --web-security-disabled) setting from prefs and send to embedded browser
+ bool web_security_disabled = gSavedSettings.getBOOL("BrowserWebSecurityDisabled");
+ media_source->setWebSecurityDisabled(web_security_disabled || clean_browser);
+
+ // collect setting indicates if local file access from file URLs is allowed from prefs and send to embedded browser
+ bool file_access_from_file_urls = gSavedSettings.getBOOL("BrowserFileAccessFromFileUrls");
+ media_source->setFileAccessFromFileUrlsEnabled(file_access_from_file_urls || clean_browser);
// As of SL-15559 PDF files do not load in CEF v91 we enable plugins
// but explicitly disable Flash (PDF support in CEF is now treated as a plugin)
@@ -1917,6 +1925,15 @@ void LLViewerMediaImpl::loadURI()
}
//////////////////////////////////////////////////////////////////////////////////////////
+void LLViewerMediaImpl::executeJavaScript(const std::string& code)
+{
+ if (mMediaSource)
+ {
+ mMediaSource->executeJavaScript(code);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::setSize(int width, int height)
{
mMediaWidth = width;
@@ -3221,8 +3238,19 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
case LLViewerMediaObserver::MEDIA_EVENT_FILE_DOWNLOAD:
{
- //llinfos << "Media event - file download requested - filename is " << self->getFileDownloadFilename() << llendl;
- LLNotificationsUtil::add("MediaFileDownloadUnsupported");
+ LL_DEBUGS("Media") << "Media event - file download requested - filename is " << plugin->getFileDownloadFilename() << LL_ENDL;
+ // pick a file from SAVE FILE dialog
+
+ // need a better algorithm that this or else, pass in type of save type
+ // from event that initiated it - this is okay for now - only thing
+ // that saves is 360s
+ std::string suggested_filename = plugin->getFileDownloadFilename();
+ LLFilePicker::ESaveFilter filter = LLFilePicker::FFSAVE_ALL;
+ if (suggested_filename.find(".jpg") != std::string::npos || suggested_filename.find(".jpeg") != std::string::npos)
+ filter = LLFilePicker::FFSAVE_JPEG;
+ if (suggested_filename.find(".png") != std::string::npos)
+ filter = LLFilePicker::FFSAVE_PNG;
+ init_threaded_picker_save_dialog(plugin, filter, suggested_filename);
}
break;