Case 21993: Globally disallow use of the camera or microphone by hosted web content
Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -2878,11 +2878,19 @@ void Application::initializeGL() { · 2877 unmodified lines | ||
| 2878 | 2878 | } |
| 2879 | 2879 | |
| 2880 | 2880 | #if !defined(DISABLE_QML) |
| 2881 | + QStringList chromiumFlags; | |
| 2882 | + // Bug 21993: disable microphone and camera input | |
| 2883 | + chromiumFlags << "--use-fake-device-for-media-stream"; | |
| 2881 | 2884 | // Disable signed distance field font rendering on ATI/AMD GPUs, due to |
| 2882 | 2885 | // https://highfidelity.manuscript.com/f/cases/13677/Text-showing-up-white-on-Marketplace-app |
| 2883 | 2886 | std::string vendor{ (const char*)glGetString(GL_VENDOR) }; |
| 2884 | 2887 | 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()); | |
| 2886 | 2894 | } |
| 2887 | 2895 | #endif |
| 2888 | 2896 | |