History

Merge pull request #15300 from jherico/fix/web_camera_master

Case 21993: Globally disallow use of the camera or microphone by hosted web content

Shannon Romano committed 7 years ago

Commit 04eac572 parents eba1f27 7d4e59b2 files · +10 −1Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+9−1
@@ -2878,11 +2878,19 @@ void Application::initializeGL() { · 2877 unmodified lines
28782878 }
28792879
28802880 #if !defined(DISABLE_QML)
2881+ QStringList chromiumFlags;
2882+ // Bug 21993: disable microphone and camera input
2883+ chromiumFlags << "--use-fake-device-for-media-stream";
28812884 // Disable signed distance field font rendering on ATI/AMD GPUs, due to
28822885 // https://highfidelity.manuscript.com/f/cases/13677/Text-showing-up-white-on-Marketplace-app
28832886 std::string vendor{ (const char*)glGetString(GL_VENDOR) };
28842887 if ((vendor.find("AMD") != std::string::npos) || (vendor.find("ATI") != std::string::npos)) {
2885− qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArray("--disable-distance-field-text"));
2888+ chromiumFlags << "--disable-distance-field-text";
2889+ }
2890+
2891+ // Ensure all Qt webengine processes launched from us have the appropriate command line flags
2892+ if (!chromiumFlags.empty()) {
2893+ qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags.join(' ').toLocal8Bit());
28862894 }
28872895 #endif
28882896