summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-12-15 14:37:18 -0700
committerDave Houlton <euclid@lindenlab.com>2021-12-15 14:37:18 -0700
commitcf35d27dfb86a8a8d8223bc344f35984efaa7b98 (patch)
tree883758ee1282e0936343ec27d80d25329aae9242 /indra/newview/llviewermedia.cpp
parent199775b7ac214cfc3492c343c3f6046effcde7ed (diff)
parent0a873cd95547f003878c6d00d0883ff792f4a865 (diff)
DRTVWR-546 merge up to 6.5.2
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 af8db76add..0a0a3f905a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1757,8 +1757,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)
@@ -1920,6 +1928,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;
@@ -3224,8 +3241,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;