PageSourceSearch

https://tlap.io/scripts/tlap-ui-diagnostics.js

js tlap.io collected 2026-10-08 16:01:39 UTC 2,075 bytes, 46 lines download raw bytes

1(function () {
2  // Keep the browser's original error visible. This diagnostic adds only
3  // bounded code locations for the observed MutationObserver target failure.
4  var reported = 0;
5
6  function locationOf(raw, line, column) {
7    try {
8      var url = new URL(raw, document.baseURI);
9      var source = 'other';
10      var path = '';
11      if (url.origin === location.origin && /^\/(?:scripts\/|_next\/static\/|_market\/_next\/static\/|w\/(?:fcs-runtime\/|positions(?:-full)?\/_next\/static\/))/.test(url.pathname)) {
12        source = 'site';
13        path = url.pathname;
14      } else if (url.hostname === 'mc.yandex.ru' && /^\/metrika\//.test(url.pathname)) {
15        source = 'yandex';
16        path = url.pathname;
17      } else if (url.hostname === 'www.googletagmanager.com' && url.pathname === '/gtag/js') {
18        source = 'google';
19        path = url.pathname;
20      }
21      if (path.length > 240 || !/^[A-Za-z0-9_./-]*$/.test(path)) path = '';
22      return { source: source, path: path, line: Number(line) || 0, column: Number(column) || 0 };
23    } catch (_) {
24      return { source: 'other', path: '', line: 0, column: 0 };
25    }
26  }
27
28  window.addEventListener('error', function (event) {
29    if (reported >= 3 || typeof event.message !== 'string' ||
30        !/MutationObserver/.test(event.message) || !/not of type ['"]Node['"]/.test(event.message)) return;
31    reported += 1;
32    var frames = [];
33    var stack = event.error && typeof event.error.stack === 'string' ? event.error.stack : '';
34    var matches = stack.slice(0, 8192).match(/https?:\/\/[^\s)]+/g) || [];
35    for (var index = 0; index < matches.length && frames.length < 8; index += 1) {
36      var frame = matches[index].match(/^(.*):(\d+):(\d+)$/);
37      if (frame) frames.push(locationOf(frame[1], frame[2], frame[3]));
38    }
39    console.warn('[TLAP UI diagnostics]', JSON.stringify({
40      event: 'mutation_observer_target',
41      context: window === window.parent ? 'top' : 'frame',
42      source: locationOf(event.filename, event.lineno, event.colno),
43      frames: frames
44    }));
45  });
46})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.