Added the property keepalive: true to disable the default browser timeout.
keepalive: true
So, the entire function is:
await fetch(endpoint, { keepalive: true } );