Make webkitvisibilitychange and document.webkitHidden work for when Safari is in the background

Originator:jasongregori
Number:rdar://14295056 Date Originated:27-Jun-2013 02:14 PM
Status:Open Resolved:
Product:Safari Product Version:iOS 7
Classification:Enhancement Reproducible:Always
 
Summary:
webkitvisibilitychange and document.webkitHidden are awesome! And they seem to be working great for when you switch to the tab selector or to another tab. However, I would like to know when my page is hidden because Safari is in the background or when the device is locked.

Steps to Reproduce:
Here is a great sample site someone set up to test it: http://mobilexweb.com/ts/api/page.html
I'm testing on an iPhone 5 running iOS 7 beta 2.
Going to the tab selector or switching tabs causes it to print out that it was hidden.
Going to the home screen, locking the phone, or going to the multitasking UI doesn't cause the "webkitvisibilitychange" event to fire.

Expected Results:
I expected the "webkitvisibilitychange" event to fire and for document.webkitHidden to return true when those things happened and then for the "webkitvisibilitychange" event to fire and for document.webkitHidden to return false when I returned to Safari and my page.

Actual Results:
The "webkitvisibilitychange" did not fire.

Thanks!
Jason

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!