From 3602d64a09fb068129cccd4f7993c0d658cc4669 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 12 Jul 2021 12:50:34 -0700 Subject: Fix for SL-15559 PDF files do not load in CEF v91 --- indra/media_plugins/cef/media_plugin_cef.cpp | 15 ++++++++++----- indra/newview/llviewermedia.cpp | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 8c1855d5cb..97ad3d54cc 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -557,8 +557,17 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.disable_network_service = mDisableNetworkService; settings.use_mock_keychain = mUseMockKeyChain; #endif + // This setting applies to all plugins, not just Flash + // Regarding, SL-15559 PDF files do not load in CEF v91, + // it turns out that on Windows, PDF support is treated + // as a plugin on Windows only so turning all plugins + // off, disabled built in PDF support. (Works okay in + // macOS surprisingly). To mitigrate this, we set the global + // media enabled flag to whatever the consumer wants and + // explicitly disable Flash with a different setting (below) + settings.plugins_enabled = mPluginsEnabled; + // SL-14897 Disable Flash support in the embedded browser - //settings.flash_enabled = mPluginsEnabled; settings.flash_enabled = false; settings.flip_mouse_y = false; @@ -571,10 +580,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.javascript_enabled = mJavascriptEnabled; settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granularity/query UI - // SL-14897 Disable Flash support in the embedded browser - //settings.plugins_enabled = mPluginsEnabled; - settings.plugins_enabled = false; - settings.user_agent_substring = mCEFLib->makeCompatibleUserAgentString(mUserAgentSubtring); settings.webgl_enabled = true; settings.log_file = mCefLogFile; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9a1403f892..556c12bafa 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1748,6 +1748,10 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); media_source->setJavascriptEnabled( javascript_enabled || 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) + media_source->setPluginsEnabled(true); + bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging"); media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled || clean_browser); -- cgit v1.2.3