Update tracker/index.js: SendBeacon() to Fetch API

This commit is contained in:
rohandebsarkar 2022-05-22 23:18:26 +05:30
parent f55ba7bd80
commit a33293066e
No known key found for this signature in database
GPG Key ID: 3DA3229799D1A181

View File

@ -122,7 +122,11 @@ import { removeTrailingSlash } from '../lib/url';
payload,
});
navigator.sendBeacon(`${root}/api/collect`, data);
fetch(`${root}/api/collect`, {
method: 'POST',
body: data,
keepalive: true,
});
};
const addEvents = node => {