1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/app/scripts/lib/bug-notifier.js

23 lines
508 B
JavaScript
Raw Normal View History

class BugNotifier {
2018-06-04 23:21:46 +02:00
notify (uri, message) {
return postData(uri, message)
}
}
2018-06-04 23:21:46 +02:00
function postData(uri, data) {
2018-06-04 23:30:24 +02:00
return fetch(uri, {
body: JSON.stringify(data), // must match 'Content-Type' header
credentials: 'same-origin', // include, same-origin, *omit
headers: {
2018-06-05 00:10:51 +02:00
'content-type': 'application/json',
},
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, cors, *same-origin
})
}
2018-06-04 23:59:46 +02:00
const notifier = new BugNotifier()
module.exports = notifier