Can I change the document method of javascript: hasFocus() to return 'true' all the time? Can I change the document method of javascript: hasFocus() to return 'true' all the time? selenium selenium

Can I change the document method of javascript: hasFocus() to return 'true' all the time?


Try this

document.__proto__.hasFocus = function() {return true}