@hom3chuk/tektek
Version:
A library for detecting technologies used within HTTP Archive (HAR)
26 lines (25 loc) • 877 B
JavaScript
import { anyJavascriptResourceContentContains, anyResourceUrlRegex } from "../../common/index.js";
var detectSentry = function (har, asap) {
if (asap === void 0) { asap = true; }
var res = {
detected: false,
name: 'Sentry.io',
reasons: [],
};
if (anyResourceUrlRegex(har, new RegExp(/\.ingest.*?\.sentry\.io\//, 'is'))) {
res.detected = true;
res.reasons.push('resource url contains sentry.io ingest url');
if (asap) {
return res;
}
}
if (anyJavascriptResourceContentContains(har, 'You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/')) {
res.detected = true;
res.reasons.push('js resource contains sentry.io code signature');
if (asap) {
return res;
}
}
return res;
};
export default detectSentry;