Skip to content

Commit

Permalink
MouseVader Firefox extension
Browse files Browse the repository at this point in the history
  • Loading branch information
fadyanwar committed Jul 31, 2022
0 parents commit 6c3da57
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Binary file added darth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions manifest.json
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"]
}
]

}

40 changes: 40 additions & 0 deletions mousevader.js
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();

0 comments on commit 6c3da57

Please sign in to comment.