This piece of code worked for me for two years to detect users who try to open devtools:
var image = new Image();
Object.defineProperty(image, 'id', {
get: function() {
$('#<element_to_remove_on_detection>').remove();
console.clear();
}
});
console.log('%c', image);
But it's not working anymore, and I don't know why. Do you know if any updates on Chrome/Opera impacted this code? There are no errors in the console. What should I do to make it work again?