@hom3chuk/tektek
Version:
A library for detecting technologies used within HTTP Archive (HAR)
28 lines (27 loc) • 831 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("../../common/index.js");
var detectMatomo = function (har, asap) {
if (asap === void 0) { asap = true; }
var res = {
detected: false,
name: 'Matomo',
reasons: [],
};
if ((0, index_js_1.anyResourceUrlContains)(har, 'https://cdn.matomo.cloud/')) {
res.detected = true;
res.reasons.push('resource url contains matomo cloud url');
if (asap) {
return res;
}
}
if ((0, index_js_1.rootBodyContains)(har, 'var _mtm = window._mtm')) {
res.detected = true;
res.reasons.push('resource url contains matomo js code url');
if (asap) {
return res;
}
}
return res;
};
exports.default = detectMatomo;