Sending HTTP requests in background

Hello there.

I’m working on a web app for web os which should support background mode. We need to send several HTTP requests when app goes to background.

I subscribed to visibilitychange event and check when document.hidden is true. It works okay.

But I see that in some cases (probably when the app does its background job too long) my HTTP requests don’t send until I go back to foreground state or requests can stuck in some “Pending” state as Chrome dev tools say.

I saw the similar problem on Tizen and it was necessary to set a special flag in app manifest to allow the app to work in background fully, but I don’t see any flag like this for Web OS.

Does anyone know something about this problem and how to solve this?

1 Like

In that case, please refer to JavaScript Service FAQ. Q5 and Q6 will be helpful. Thank you.

Thank you for the answer! Unfortunately I cannot use this API use. This links are about JS services, but I’m working on web application, not a service. May be you have an idea how to do this for web app?

The webOS TV supports multi-tasking. However, if memory is insufficient, apps in the background can be terminated. It is normal operation, and no API is provided to prevent this. Furthermore, some of FHD and UHD TVs have low memory capacity, so apps are terminated automatically when entering the background. We think you should consider this. Thank you.