imdonix / canvas-antidetect

A script which prevent canvas to capture focused/blurred events
12 stars 3 forks source link

im new but how exactly does the code put in the payload #3

Closed ItsLaggy closed 2 years ago

ItsLaggy commented 2 years ago

how does this block the focus and blur event listeners and input the payload

Window.prototype.realEventListener = Window.prototype.addEventListener Window.prototype.addEventListener = (a,b,c) => { if(a == 'focus' || a == 'blur') console.log([AD] '${a}' event subscription prevented.) else realEventListener(a,b,c); }

imdonix commented 2 years ago

I'm not sure what you are asking exactly, but if you mean:

  1. How the script injected to the page the anwser is Tempermonkey.
  2. How canvas capturing events: Basically canvas has its own event tracker system which is collecting information and send the collected data in a given interval in these payloads. In these 2 case 'blur' & 'focus the system use the built in window.addEventListener. How I know this? Canvas is open source you can see the related code HERE
  3. How this script prevent that to happen: the script use a technique called prototype pollution.
ItsLaggy commented 2 years ago

ok thanks that helped a lot