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

Quelle  test_innerhtml_sanitizer.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/security/test/general/test_innerhtml_sanitizer.html


<!DOCTYPE HTML>
<html>
<head>
  <meta charset=utf-8>
  <title>Test for Bug 1667113</title>
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1667113">Mozilla Bug 1667113</a>
<div></div>
<script>
SimpleTest.waitForExplicitFinish();

// Please note that 'fakeServer' does not exist because the test relies
// on "csp-on-violate-policy" , and "specialpowers-http-notify-request"
// which fire if either the request is blocked or fires. The test does
// not rely on the result of the load.

function fail() {
  ok(false, "Should not call this")
}

function examiner() {
  SpecialPowers.addObserver(this, "csp-on-violate-policy");
  SpecialPowers.addObserver(this, "specialpowers-http-notify-request");
}
examiner.prototype  = {
  observe(subject, topic, data) {
    if (topic === "csp-on-violate-policy") {
      let asciiSpec = SpecialPowers.getPrivilegedProps(
                       SpecialPowers.do_QueryInterface(subject, "nsIURI"),
                       "asciiSpec");
      if (asciiSpec.includes("fakeServer")) {
        ok (false, "Should not attempt fetch, not even blocked by CSP.");
      }
    }

    if (topic === "specialpowers-http-notify-request") {
      if (data.includes("fakeServer")) {
        ok (false, "Should not try fetch");
      }
    }
  },
  remove() {
    SpecialPowers.removeObserver(this, "csp-on-violate-policy");
    SpecialPowers.removeObserver(this, "specialpowers-http-notify-request");
  }
}

window.examiner = new examiner();

let div = document.getElementsByTagName("div")[0];
div.innerHTML = "





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.