javascript triggering window in safari when in webapp