use text/plain on /api/metrics
This commit is contained in:
parent
b30be6e4a2
commit
8eaacfea18
4 changed files with 11 additions and 5 deletions
|
@ -41,13 +41,17 @@ function submitEvents() {
|
|||
events
|
||||
})
|
||||
],
|
||||
{ type: 'application/json' }
|
||||
{ type: 'text/plain' } // see http://crbug.com/490015
|
||||
);
|
||||
events.splice(0);
|
||||
if (!navigator.sendBeacon) {
|
||||
return;
|
||||
}
|
||||
navigator.sendBeacon('/api/metrics', data);
|
||||
try {
|
||||
navigator.sendBeacon('/api/metrics', data);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
async function addEvent(event_type, event_properties) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue