How to measure the number of JavaScript functions that define newlines

I looked at this article in which they use HTMLUnit to "measure the number of calls to JavaScript functions that can be used to determine new lines (e.g., a substring and fromCharCode), as well as the number of lines used (e.g., write operations and eval calls).

I am new to HTMLUnit and I cannot figure out how to directly see the functions that the website uses and to calculate which ones are substring, eval, etc.? How can I do that?

+4
source share
1 answer

The easiest way is to neutralize all your own challenges. For instance:

const original = String.fromCharCode;
String.fromCharCode = function(...args) {
  console.log('creating new string');
  return original.apply(this, args);
}
console.log(String.fromCharCode(65, 66, 67));
Run codeHide result

, . , ( ) eval .
DOM, MutationObservers.

+1

Source: https://habr.com/ru/post/1686083/


All Articles