[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbutton/master] Bug 4755: Spoof screen coords for DOM MouseEvents



commit 950f9d89e069c6ed54d7e0af7f738690d047442f
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date:   Tue Dec 20 21:04:07 2011 -0800

    Bug 4755: Spoof screen coords for DOM MouseEvents
    
    Helps reduce fingerprinting linkability:
    https://www.torproject.org/projects/torbrowser/design/#fingerprinting-linkability
---
 src/chrome/content/jshooks4.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/chrome/content/jshooks4.js b/src/chrome/content/jshooks4.js
index f5573ac..655a04d 100644
--- a/src/chrome/content/jshooks4.js
+++ b/src/chrome/content/jshooks4.js
@@ -28,6 +28,12 @@ window.__HookObjects = function() {
           Object.defineProperty(window.__proto__, "screenY",
                           {get: function() { return 0;},
                           configurable: false});
+          Object.defineProperty(MouseEvent.prototype, "screenX",
+                          {get: function() { return this.clientX;},
+                          configurable: false});
+          Object.defineProperty(MouseEvent.prototype, "screenY",
+                          {get: function() { return this.clientY;},
+                          configurable: false});
 
           // We can't define individual getters/setters for window.screen 
           // for some reason. works in html but not in these hooks.. No idea why

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits