feat(scripts): improve reports

This commit is contained in:
wanhose 2021-11-10 11:40:26 +01:00
parent d0f8417591
commit dd6f6c9974

View File

@ -178,11 +178,13 @@ const getTab = (callback) => {
const report = () => { const report = () => {
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
const tab = tabs[0]; const tab = tabs[0];
const userAgent = window.navigator.userAgent;
const version = chrome.runtime.getManifest().version;
if (tab) { if (tab) {
fetch("https://cdm-report-service.herokuapp.com/rest/v1/report/", { fetch("https://cdm-report-service.herokuapp.com/rest/v1/report/", {
body: JSON.stringify({ body: JSON.stringify({
text: tab.url, text: `There's a problem with ${tab.url} using ${userAgent} in CDM ${version}`,
to: "wanhose.development@gmail.com", to: "wanhose.development@gmail.com",
subject: "Cookie Dialog Monster Report", subject: "Cookie Dialog Monster Report",
}), }),