mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-23 16:52:31 +01:00
12 lines
517 B
JavaScript
12 lines
517 B
JavaScript
export function report(msg, error, link, lineNo, columnNo) {
|
|
if (window.navigator.onLine === false) return Promise.resolve();
|
|
let url = "/report?";
|
|
url += "url="+encodeURIComponent(location.href)+"&";
|
|
url += "msg="+encodeURIComponent(msg)+"&";
|
|
url += "from="+encodeURIComponent(link)+"&";
|
|
url += "from.lineNo="+lineNo+"&";
|
|
url += "from.columnNo="+columnNo;
|
|
if (error) url += "error="+encodeURIComponent(error.message)+"&";
|
|
|
|
return fetch(url, { method: "post" }).catch(() => {});
|
|
}
|