JavaScript Restrictor
polcak.github.io
polcak.github.io
> The extension is[...] currently under the name of JavaScript Restrictor but it will be renamed to JShelter soon.
FSF funding announcement: <https://www.fsf.org/news/fsf-announces-jshelter-browser-add-...>
Discussed two days ago: <https://news.ycombinator.com/item?id=28736113>
I thing this was a common concern with the first few generations of content blockers, one that's mostly proved to be a non-issue. It's not my space, but if I had to take two guesses:
1. Most analytics code is sufficiently flaky and unreliable to keep it far away from the critical concrete value path of someone actually paying with a card.
2. Most developers are probably running content blockers.
Not sure if such thing would be really feasible without breaking half of the web, but I envision that it could bring nice perf improvements and block many sorts of nasty user behavior tracking
Lots of webdevs abuse this, however, to start an interval with "privileged" rights that will do all things just in a centralized loop after the user did the first interaction with the website.
So I'd kinda argue that this security concept is a little flawed. Something like OPs approach to override the APIs with monkey patched checks seems promising. I hope there won't be bypasses or quirks with different web worker or iframe contexts.
I'd agree that its not a model that works in an adversarial setting. But it does hopefully nudge some devs to "right" direction.