Skip to content

Commit

Permalink
Fix headless leak #26 beta.11
Browse files Browse the repository at this point in the history
Forces the default pointer value to a mouse-type pointer, fixing the detection issues on headless browsers.
  • Loading branch information
daijro committed Oct 9, 2024
1 parent bd59304 commit 49cea6e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions patches/force-default-pointer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp
index cc86d1abf6..bfc4d0f1d8 100644
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -372,24 +372,10 @@ static PointerCapabilities GetPointerCapabilities(const Document* aDocument,

// The default value for Desktop is mouse-type pointer, and for Android
// a coarse pointer.
- const PointerCapabilities kDefaultCapabilities =
#ifdef ANDROID
- PointerCapabilities::Coarse;
-#else
- PointerCapabilities::Fine | PointerCapabilities::Hover;
+ return PointerCapabilities::Coarse;
#endif
- if (aDocument->ShouldResistFingerprinting(
- RFPTarget::CSSPointerCapabilities)) {
- return kDefaultCapabilities;
- }
-
- int32_t intValue;
- nsresult rv = LookAndFeel::GetInt(aID, &intValue);
- if (NS_FAILED(rv)) {
- return kDefaultCapabilities;
- }
-
- return static_cast<PointerCapabilities>(intValue);
+ return PointerCapabilities::Fine | PointerCapabilities::Hover;
}

PointerCapabilities Gecko_MediaFeatures_PrimaryPointerCapabilities(
2 changes: 1 addition & 1 deletion upstream.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=130.0.1
release=beta.10
release=beta.11

0 comments on commit 49cea6e

Please sign in to comment.