var cheaterFunc = function () {
console.error('cheater!');
// report cheater to server somehow...
};
$('*').each(function (i, el) {
if (el instanceof Object) {
Object.defineProperties(el, {
innerHTML: {get: cheaterFunc},
innerText: {get: cheaterFunc}
});
}
});
...and of course to defeat this, you could simply use a tampering proxy to prevent this javascript from making it to the browser.
(There are probably other ways to get the value of each digit with javascript, but you should be able to just add cheaterFunc to each of those. .childNode, change the style to use a custom font where each number has a different, predictable width and test .offsetWidth, etc.)
(There are probably other ways to get the value of each digit with javascript, but you should be able to just add cheaterFunc to each of those. .childNode, change the style to use a custom font where each number has a different, predictable width and test .offsetWidth, etc.)