Implemented Q.onVisibilityChange event