mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
23 lines
508 B
JavaScript
23 lines
508 B
JavaScript
class BugNotifier {
|
|
notify (uri, message) {
|
|
return postData(uri, message)
|
|
}
|
|
}
|
|
|
|
function postData(uri, data) {
|
|
return fetch(uri, {
|
|
body: JSON.stringify(data), // must match 'Content-Type' header
|
|
credentials: 'same-origin', // include, same-origin, *omit
|
|
headers: {
|
|
'content-type': 'application/json',
|
|
},
|
|
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
|
mode: 'cors', // no-cors, cors, *same-origin
|
|
})
|
|
}
|
|
|
|
const notifier = new BugNotifier()
|
|
|
|
module.exports = notifier
|
|
|