tor-browser

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

source-blackbox.js (782B)


      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 
      5 export function getBlackBoxRanges(state) {
      6  return state.sourceBlackBox.blackboxedRanges;
      7 }
      8 
      9 export function isSourceBlackBoxed(state, source) {
     10  // Only sources with a URL can be blackboxed.
     11  if (!source.url) {
     12    return false;
     13  }
     14  return state.sourceBlackBox.blackboxedSet.has(source.url);
     15 }
     16 
     17 export function isSourceOnSourceMapIgnoreList(state, source) {
     18  if (!source) {
     19    return false;
     20  }
     21  return getIgnoreListSourceUrls(state).includes(source.url);
     22 }
     23 
     24 export function getIgnoreListSourceUrls(state) {
     25  return state.sourceBlackBox.sourceMapIgnoreListUrls;
     26 }