summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
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;