Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

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.2 Sekunden  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=434850
#Domains=655579