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

Quelle  network-overrides.js   Sprache: JAVA

 
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */


"use strict";

const DevToolsUtils = require("resource://devtools/shared/DevToolsUtils.js");

exports.setNetworkOverride = setNetworkOverride;
function setNetworkOverride(commands, url, data, win) {
  return async function ({ dispatch }) {
    const filename = url.split("/").at(-1);
    if (typeof data == "string") {
      data = new TextEncoder().encode(data);
    }

    const path = await DevToolsUtils.saveAs(win, data, filename);
    if (path) {
      const hasWatcherSupport =
        commands.targetCommand.hasTargetWatcherSupport();
      if (hasWatcherSupport) {
        const networkFront =
          await commands.targetCommand.watcherFront.getNetworkParentActor();
        await networkFront.override(url, path);
        dispatch({
          type: "SET_NETWORK_OVERRIDE",
          url,
          path,
        });
      }
    }
  };
}

exports.removeNetworkOverride = removeNetworkOverride;
function removeNetworkOverride(commands, url) {
  return async function ({ dispatch }) {
    const hasWatcherSupport = commands.targetCommand.hasTargetWatcherSupport();
    if (hasWatcherSupport) {
      const networkFront =
        await commands.targetCommand.watcherFront.getNetworkParentActor();
      networkFront.removeOverride(url);
      dispatch({
        type: "REMOVE_NETWORK_OVERRIDE",
        url,
      });
    }
  };
}

97%


¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© 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 ist noch experimentell.