Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

A Measurement That Never Ran Became a Verdict: A Second Automated Chrome Answered for the First

Описание и применение

Скрипт, проверяющий доступность карты сайта и индексацию страниц SEO‑хаба, неверно обрабатывал ошибки чтения из Chrome, считая их нулевыми, что приводило к ложным решениям. Добавлен предварительный контроль количества процессов Chrome и защита в логике вердикта, чтобы ошибки чтения трактовались как «неизвестно», а не как ноль.

Задача

An unattended script that checks sitemap accessibility and SEO‑hub indexing failed silently because it used two different scripting bridges that could target different Chrome instances, causing read failures to be treated as zero and leading to incorrect verdicts.

Результат

The script now correctly detects when multiple Chrome instances exist and prevents false positives/negatives by treating read failures as unknown rather than zero, ensuring accurate monitoring decisions.

Рабочий процесс

  • 1. Count running Chrome application instances, filtering out helper and renderer processes.
  • 2. If more than one instance, write a precondition‑failed section, run only non‑browser checks, and exit with status 2.
  • 3. If one instance, open a tab using AppleScript and read it back using JXA.
  • 4. If any read fails (tab not found), record failure and skip verdict rules.
  • 5. If all reads succeed, apply existing sitemap and seo‑hub rules to produce a verdict.
  • 6. Write the report with verdict or failure status.

Доказательства

The script opens a tab with one scripting bridge (AppleScript) and reads it back with a different one (JXA, Apple's JavaScript automation layer).

Источник

If it finds more than one, it writes what it found to a “precondition failed” section of the report, runs only the one check in the script that doesn’t touch a browser at all, and exits with a distinct status code — 2 — meaning “cannot judge, measurement not performed.”

Источник

The function that decides whether to keep going or issue one of its two halt recommendations now checks, before applying either rule, whether the sitemap read failed or every single URL check failed. If so, it refuses to apply the rule and reports “cannot judge, measurement failed” instead.

Источник

  • Дата записи: 2026-09-19T11:15:37.645Z