tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

network-overrides.js (663B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
      4 "use strict";
      5 
      6 exports.reducer = networkOverridesReducer;
      7 function networkOverridesReducer(
      8  state = {
      9    mutableOverrides: {},
     10  },
     11  action
     12 ) {
     13  switch (action.type) {
     14    case "SET_NETWORK_OVERRIDE": {
     15      state.mutableOverrides[action.url] = action.path;
     16      return { ...state };
     17    }
     18    case "REMOVE_NETWORK_OVERRIDE": {
     19      delete state.mutableOverrides[action.url];
     20      return { ...state };
     21    }
     22    default:
     23      return state;
     24  }
     25 }