Via a CORS request, check that a remote site can be reached. This could be the start of an SPA monitoring framework.
CORS
Control zone
Auto:
On
Off
Is internet alive?
Data zone