diff --git a/patches/webgl-spoofing.patch b/patches/webgl-spoofing.patch index a6aafb16..af6de473 100644 --- a/patches/webgl-spoofing.patch +++ b/patches/webgl-spoofing.patch @@ -272,8 +272,8 @@ index a1e5c4792d..be99491bf8 100644 } @@ -2573,7 +2573,11 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, - switch (pname) { - case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_RENDERER_WEBGL: + switch (pname) { + case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_RENDERER_WEBGL: + if (auto value = MaskConfig::GetString("webGl:renderer")) { + ret = Some(value.value()); + break; @@ -282,12 +282,12 @@ index a1e5c4792d..be99491bf8 100644 ret = Some("Mozilla"_ns); } else { ret = GetUnmaskedRenderer(); - if (ret && StaticPrefs::webgl_sanitize_unmasked_renderer()) { - ret = Some(webgl::SanitizeRenderer(*ret)); + if (ret && StaticPrefs::webgl_sanitize_unmasked_renderer()) { + ret = Some(webgl::SanitizeRenderer(*ret)); @@ -2584,6 +2588,10 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, - break; + break; - case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_VENDOR_WEBGL: + case dom::WEBGL_debug_renderer_info_Binding::UNMASKED_VENDOR_WEBGL: + if (auto value = MaskConfig::GetString("webGl:vendor")) { + ret = Some(value.value()); + break; @@ -295,19 +295,19 @@ index a1e5c4792d..be99491bf8 100644 ret = ShouldResistFingerprinting(RFPTarget::WebGLRenderInfo) ? Some("Mozilla"_ns) : GetUnmaskedVendor(); - break; + break; @@ -2675,7 +2683,9 @@ void ClientWebGLContext::GetParameter(JSContext* cx, GLenum pname, - case LOCAL_GL_COLOR_WRITEMASK: { - const auto mask = uint8_t(*maybe); - const auto bs = std::bitset<4>(mask); + case LOCAL_GL_COLOR_WRITEMASK: { + const auto mask = uint8_t(*maybe); + const auto bs = std::bitset<4>(mask); - const auto src = std::array{bs[0], bs[1], bs[2], bs[3]}; + const auto src = MaskConfig::MParamGL>( + pname, std::array{bs[0], bs[1], bs[2], bs[3]}, + mIsWebGL2); - JS::Rooted arr(cx); - if (!dom::ToJSValue(cx, src.data(), src.size(), &arr)) { - rv = NS_ERROR_OUT_OF_MEMORY; + JS::Rooted arr(cx); + if (!dom::ToJSValue(cx, src.data(), src.size(), &arr)) { + rv = NS_ERROR_OUT_OF_MEMORY; @@ -3091,6 +3101,24 @@ ClientWebGLContext::GetShaderPrecisionFormat(const GLenum shadertype, const FuncScope funcScope(*this, "getShaderPrecisionFormat"); if (IsContextLost()) return nullptr;