-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6c3da57
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
|
||
"manifest_version": 2, | ||
"name": "MouseVader", | ||
"version": "1.2", | ||
|
||
"description": "A privacy tool that mislead trackers by creating noise in the collected user behavioral data via fake random mouse movement events in the background so it doesn't impact user experience", | ||
|
||
"icons": { | ||
"860": "darth.png" | ||
}, | ||
|
||
"content_scripts": [ | ||
{ | ||
"matches": ["<all_urls>"], | ||
"js": ["mousevader.js"] | ||
} | ||
] | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//DarthVader is a privacy tool intended to confuse trackers by creating noise in the collected data | ||
//Written by Fady Anwar | ||
|
||
var overevent = new MouseEvent("mouseover", { | ||
"view": window, | ||
"bubbles": true, | ||
"cancelable": true | ||
}); | ||
|
||
var outevent = new MouseEvent("mouseout", { | ||
"view": window, | ||
"bubbles": true, | ||
"cancelable": true | ||
}); | ||
|
||
function fakeHovers(){ | ||
let elements = document.getElementsByTagName("div"); | ||
let counter = 0; | ||
//iteraring elements bottm up to hit more recent ones first, i.e. for virtual doms of bottomless timelines | ||
for(var i = elements.length-1; i > 0; i--){ | ||
if(Math.random() > 0.95){ | ||
elements[i].dispatchEvent(overevent); | ||
elements[i].dispatchEvent(outevent); | ||
counter += 2; | ||
|
||
//capping hovers | ||
if(counter >= 500) | ||
break; | ||
} | ||
} | ||
console.log(counter + " fake mouse events dispatched!"); | ||
//backoff mechanism: more elements = longer timeout | ||
let timeout = 5000 + elements.length; | ||
console.log("Next round in " + timeout + " milliseconds"); | ||
setTimeout(fakeHovers, timeout); | ||
} | ||
|
||
|
||
console.log("Faking mouse movements started!"); | ||
fakeHovers(); |