3 ms·
One scenario where you have to do something similar to this is as an extension author, because some websites are hostile to the user. A couple examples from my
by kevingadd 5y ago
One scenario where you have to do something similar to this is as an extension author, because some websites are hostile to the user. A couple examples from my past:
A non-profit built an extension that would scrape data on advertisements from users' facebook feeds (opt-in). Facebook decided they weren't a fan of this so they introduced some special mouse event handlers designed to identify mouse events generated by extensions (and unfortunately, accessibility tools). I worked with the extension author to introduce a very elaborate set of tricks to forge the 'event not generated from user input' flag so that it would keep working.
Another scenario was that I maintained an accessibility extension (keyboard shortcuts, tooltips, etc) for a browser game. The developers became increasingly hostile to extensions in general because some people used extensions to cheat. Over time I had to do things like forge properties, mask events, hide DOM elements, forge property/method names and toString values, forge stack traces, and automatically shut off functionality in response to anti-cheat code changes (using a custom structural hashing algorithm for JS I created). They still eventually found ways to detect this unfortunately and used that to aggressively harass and then ban users of my extension, but I kept the arms race up for a year or two. Chrome is very bad at protecting extension users from hostile pages - there are various ways to detect whether a user has an extension installed/enabled and it's very difficult to stop that. Most extensions also need to inject scripts into the page to work due to the poor design of WebExtensions and that is also sadly detectable :(
Oddly one far more robust approach to work around these issues is by writing a custom Chrome debugger using their debugging protocol. Custom debuggers can forge real input events, block script execution, filter stack traces, silence exceptions, etc. I eventually prototyped a replacement using this approach and got it working but it really wasn't worth the hassle.
- josephcsible 5y ago> (and unfortunately, accessibility tools) Why did this problem need a technical solution then? Wouldn't an ADA lawsuit have both solved it plus given Facebook a very strong financial incentive to never do such a thing again?
- kevingadd 5y agoLet me know if you manage to actually find a lawyer willing to file an ADA lawsuit over a website. I tried, most bar associations don't even have anyone to refer you to.