Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_frame_ancestors_ro.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/security/test/csp/test_frame_ancestors_ro.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test for frame-ancestors support in Content-Security-Policy-Report-Only</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<iframe style="width: 100%" id="cspframe"></iframe>
<script type="text/javascript">
const docUri = "http://mochi.test:8888/tests/dom/security/test/csp/file_frame_ancestors_ro.html";
const frame = document.getElementById("cspframe");

let testResults = {
  reportFired: false,
  frameLoaded: false
};

function checkResults(reportObj) {
  let cspReport = reportObj["csp-report"];
  is(cspReport["document-uri"], docUri, "Incorrect document-uri");

  // we can not test for the whole referrer since it includes platform specific information
  is(cspReport.referrer, document.location.toString(), "Incorrect referrer");
  is(cspReport["blocked-uri"], document.location.toString(), "Incorrect blocked-uri");
  is(cspReport["violated-directive"], "frame-ancestors""Incorrect violated-directive");
  is(cspReport["original-policy"], "frame-ancestors 'none'; report-uri http://mochi.test:8888/foo.sjs""Incorrect original-policy");
  testResults.reportFired = true;
}

let chromeScriptUrl = SimpleTest.getTestFileURL("file_report_chromescript.js");
let script = SpecialPowers.loadChromeScript(chromeScriptUrl);

script.addMessageListener('opening-request-completed', function ml(msg) {
  if (msg.error) {
    ok(false, "Could not query report (exception: " + msg.error + ")");
  } else {
    try {
      let reportObj = JSON.parse(msg.report);
      // test for the proper values in the report object
      checkResults(reportObj);
    } catch (e) {
      ok(false, "Error verifying report object (exception: " + e + ")");
    }
  }

  script.removeMessageListener('opening-request-completed', ml);
  script.sendAsyncMessage("finish");
  checkTestResults();
});

frame.addEventListener( 'load', () => {
  // Make sure the frame is still loaded
  testResults.frameLoaded = true;
  checkTestResults()
} );

function checkTestResults() {
  if( testResults.reportFired && testResults.frameLoaded ) {
    SimpleTest.finish();
  }
}

SimpleTest.waitForExplicitFinish();
frame.src = docUri;

</script>
</body>
</html>

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

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-05) ¤

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

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik