Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/tests/mochitest/bugs/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  file_bug346659.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/tests/mochitest/bugs/file_bug346659.html


<script>
function assert(cond, msg) {
  console.assert(cond, msg);
  if (!cond) {
    (window.opener || window.parent).postMessage({ type: 'error', msg }, '*');
    throw new Error(msg);
  }
}

function assert_if(when, cond, msg) {
  if (when) assert(cond, msg);
}

addEventListener("load", () => {
  const params = new URLSearchParams(location.search);
  const testId = params.get("testId");
  const type = params.get("type");
  const method = params.get("method") || 'load';
  const childHost = params.get("childHost") || location.host;

  assert(type == 'popup' || type == 'iframe''type must be popup or iframe');
  assert(method == 'write' || method == 'load''method must be write or load');
  assert(testId != null && !isNaN(testId), 'must provide testId');
  assert_if(method == 'write', !params.get("childHost"), 'childHost does not apply for method=write');

  let childURL = new URL(`bug346659-echoer.html?${testId}`, document.baseURI);
  childURL.host = childHost;

  if (method == 'write') {
    childURL = new URL('about:blank');
  }

  let childWindow;
  if (type == 'popup') {
    childWindow = window.open(childURL);
  } else if (type == 'iframe') {
    const iframe = document.createElement("iframe");
    iframe.src = childURL;
    document.body.append(iframe);
    childWindow = iframe.contentWindow;
  }
  childWindow.x = testId;

  if (method == 'write') {
    try {
      childWindow.document.write(`
        <script>
          const testNum = decodeURIComponent(window.location.search.substring(1));
          (window.opener || window.parent).postMessage("${testId} - " + window.x, "*");
          window.close();
        </scr`+`ipt>
      `)
    } catch (e) {
      if (e.name != "SecurityError" || e.code != 18) {
        assert(false, `Unknown error ${e.name}: ${e.message}`);
      }
      // Security error on cross-site write() is fine
      childWindow.close();
    }
  }
})

addEventListener("message", ({ data }) => {
  // forward further to test
  (window.opener || window.parent).postMessage(data, "*");
  // We expect to be done once we received a message
  window.close();
})
</script>

Messung V0.5 in Prozent
C=91 H=100 G=95

¤ Dauer der Verarbeitung: 0.25 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.