UNPKG

@hom3chuk/tektek

Version:

A library for detecting technologies used within HTTP Archive (HAR)

28 lines (27 loc) 941 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var index_js_1 = require("../../common/index.js"); var detectSentry = function (har, asap) { if (asap === void 0) { asap = true; } var res = { detected: false, name: 'Sentry.io', reasons: [], }; if ((0, index_js_1.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 ((0, index_js_1.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; }; exports.default = detectSentry;