Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_schemeless.js

  Sprache: JAVA
 

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


"use strict";

// Test that HTTPS-Only takes precedence over schemeless HTTPS-First by checking
// that the HTTPSFIRST_LOAD_INSECURE_ALLOW permission is only respected on
// schemeless inputs when HTTPS-Only is disabled.

ChromeUtils.defineLazyGetter(this"UrlbarTestUtils", () => {
  const { UrlbarTestUtils: module } = ChromeUtils.importESModule(
    "resource://testing-common/UrlbarTestUtils.sys.mjs"
  );
  module.init(this);
  return module;
});

function runTest(aExpectedScheme, aDesc) {
  return BrowserTestUtils.withNewTab("about:blank", async function (browser) {
    const loaded = BrowserTestUtils.browserLoaded(browser, falsenulltrue);
    await UrlbarTestUtils.promiseAutocompleteResultPopup({
      window,
      value: "example.com",
    });
    EventUtils.synthesizeKey("KEY_Enter");
    await loaded;

    is(browser.currentURI.scheme, aExpectedScheme, aDesc);
  });
}

add_task(async function test_schemeless() {
  Services.perms.addFromPrincipal(
    Services.scriptSecurityManager.createContentPrincipalFromOrigin(
      // eslint-disable-next-line @microsoft/sdl/no-insecure-url
      "http://example.com"
    ),
    "https-only-load-insecure",
    Ci.nsIHttpsOnlyModePermission.HTTPSFIRST_LOAD_INSECURE_ALLOW
  );

  await SpecialPowers.pushPrefEnv({
    set: [
      ["dom.security.https_first"true],
      ["dom.security.https_first_schemeless"true],
    ],
  });

  await runTest(
    "http",
    "HTTPSFIRST_LOAD_INSECURE_ALLOW should apply if HTTPS-Only is disabled"
  );

  await SpecialPowers.pushPrefEnv({
    set: [["dom.security.https_only_mode"true]],
  });

  await runTest(
    "https",
    "HTTPSFIRST_LOAD_INSECURE_ALLOW should not apply if HTTPS-Only is enabled"
  );

  Services.perms.removeAll();
});

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

¤ Dauer der Verarbeitung: 0.30 Sekunden  (vorverarbeitet am  2026-08-27) ¤

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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=476070
#Domains=661743