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

Quelle  test_bug519928.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/editor/composer/test/test_bug519928.html


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=519928
-->

<head>
  <title>Test for Bug 519928</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=519928">Mozilla Bug 519928</a>
<p id="display"></p>
<div id="content">
<iframe id="load-frame"></iframe>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

var iframe = document.getElementById("load-frame");

function enableJS() { allowJS(true, iframe); }
function disableJS() { allowJS(false, iframe); }
function allowJS(allow, frame) {
  SpecialPowers.wrap(frame.contentWindow).windowGlobalChild.windowContext.allowJavascript = allow;
}

function expectJSAllowed(allowed, testCondition, callback) {
  window.ICanRunMyJS = false;
  var self_ = window;
  testCondition();

  var doc = iframe.contentDocument;
  doc.body.innerHTML = "";
  var innerFrame = doc.querySelector("iframe");
  innerFrame.addEventListener("load", function() {
    var msg = "The inner iframe should" + (allowed ? "" : " not") + " be able to run Javascript";
    is(self_.ICanRunMyJS, allowed, msg);
    callback();
  }, {once: true});
  // eslint-disable-next-line no-useless-concat
  var iframeSrc = "