Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/security/test/csp/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_win_open_blocked.html

  Sprache: HTML
 

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


<!DOCTYPE html>
<html>
<head>
  <!-- we have to allowlist the actual script that spawns the tests,
       hence the nonce.-->

  <meta http-equiv="Content-Security-Policy" content="default-src 'none';
                    script-src 'nonce-foo'; style-src 'nonce-foo'">
  <script nonce="foo" src="/tests/SimpleTest/SimpleTest.js">
  </script>
  <link nonce="foo" rel="stylesheet" type="text/css"
                    href="/tests/SimpleTest/test.css"/>
  <!-- this script block with window.open and document.open will not
       be executed, since default-src is none -->

  <script>
    let win = window.open('file_default_src_none_csp.html');
    document.open();
    document.write("<script type='application/javascript'>" +
                   "  window.opener.postMessage('document-opened', '*');" +
                   "<\/script>");
    document.close();
  </script>
  <script nonce="foo">
    SimpleTest.waitForExplicitFinish();
    SimpleTest.requestFlakyTimeout("have to test that opening a " +
                                   "new window/document has not succeeded");
    window.addEventListener("message", receiveMessage);
    let checkWindowStatus = false;
    let checkDocumentStatus = false;

    function receiveMessage(event) {
      window.removeEventListener("message", receiveMessage);
        if (event.data == "window-opened") {
          checkWindowStatus = true;
          win.close();
        }
        if (event.data == "document-opened") {
          checkDocumentStatus = true;
          doc.close();
        }
    }
    setTimeout(function () {
        is(checkWindowStatus, false,
          "window shouldn't be opened");
        is(checkDocumentStatus, false,
          "document shouldn't be opened");
        SimpleTest.finish();
    }, 1500);
  </script>
</head>
<body>
</body>
</html>

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

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet am  2026-04-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.