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

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 => {