Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/xhr/tests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 933 B image not shown  

Quelle  browser_block_sync_xhr_system_requests.js

  Sprache: JAVA
 

/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */


add_task(async function test_block_sync_xhr_requests() {
  await SpecialPowers.pushPrefEnv({
    set: [["network.xhr.block_sync_system_requests"true]],
  });

  Assert.throws(
    () => {
      let xhr = new XMLHttpRequest();
      // false means a synchronous request
      xhr.open("GET""https://example.com", false);
      xhr.send();
    },
    /NetworkError/,
    "Sync XHR coming from system requests should be blocked"
  );
});

add_task(async function test_not_block_sync_xhr_requests() {
  await SpecialPowers.pushPrefEnv({
    set: [["network.xhr.block_sync_system_requests"false]],
  });

  let xhr = new XMLHttpRequest();
  xhr.open("GET""https://example.com", false);
  xhr.send();

  is(
    xhr.status,
    200,
    "Sync XHR coming from system requests should be allowed when pref is false"
  );
});

Messung V0.5 in Prozent
C=89 H=75 G=82

¤ Dauer der Verarbeitung: 0.3 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.