Note: I’m the author of the article.
I know, the solution presented there isn’t perfect. But IMHO it’s as close as it gets, and it should be sufficiently advanced that detection should be complicated due to differences in browsers and extensions.
I know, the solution presented there isn’t perfect. But IMHO it’s as close as it gets, and it should be sufficiently advanced that detection should be complicated due to differences in browsers and extensions.
How about replacing the original method (on the prototype) with a proxy to that method that intercepts apply?
original_functions[Function.prototype.toString.toString()] = originalToStringStr;