UNPKG

@hom3chuk/tektek

Version:

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

26 lines (25 loc) 750 B
import { anyResourceUrlContains, rootBodyContains } from "../../common/index.js"; var detectMatomo = function (har, asap) { if (asap === void 0) { asap = true; } var res = { detected: false, name: 'Matomo', reasons: [], }; if (anyResourceUrlContains(har, 'https://cdn.matomo.cloud/')) { res.detected = true; res.reasons.push('resource url contains matomo cloud url'); if (asap) { return res; } } if (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; }; export default detectMatomo;