document.hasFocus() doesn't always work as intended in Chrome stable.

See crbug.com/64846