Better, simpler visibility API.
No need to polyfill for Gecko anymore.
Fix #1129.