Home / File/ tabsManager.js — react Source File

tabsManager.js — react Source File

Architecture documentation for tabsManager.js, a javascript file in the react codebase. 2 imports, 1 dependents.

File javascript BabelCompiler Validation 2 imports 1 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  340180c0_7449_8026_336c_23b84d74eda4["tabsManager.js"]
  cd146827_202a_fba8_b239_a991594bc85b["setExtensionIconAndPopup.js"]
  340180c0_7449_8026_336c_23b84d74eda4 --> cd146827_202a_fba8_b239_a991594bc85b
  368ac68f_212b_9479_f106_0b8ecb79f676["setExtensionIconAndPopup"]
  340180c0_7449_8026_336c_23b84d74eda4 --> 368ac68f_212b_9479_f106_0b8ecb79f676
  406e0fbd_f3e8_fc3b_d05b_4922f1996e21["index.js"]
  406e0fbd_f3e8_fc3b_d05b_4922f1996e21 --> 340180c0_7449_8026_336c_23b84d74eda4
  style 340180c0_7449_8026_336c_23b84d74eda4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/* global chrome */

'use strict';

import setExtensionIconAndPopup from './setExtensionIconAndPopup';

function isRestrictedBrowserPage(url) {
  if (!url) {
    return true;
  }

  const urlProtocol = new URL(url).protocol;
  return urlProtocol === 'chrome:' || urlProtocol === 'about:';
}

function checkAndHandleRestrictedPageIfSo(tab) {
  if (tab && isRestrictedBrowserPage(tab.url)) {
    setExtensionIconAndPopup('restricted', tab.id);
  }
}

// Update popup page of any existing open tabs, if they are restricted browser pages
chrome.tabs.query({}, tabs => tabs.forEach(checkAndHandleRestrictedPageIfSo));
chrome.tabs.onCreated.addListener(tab => checkAndHandleRestrictedPageIfSo(tab));

// Listen to URL changes on the active tab and update the DevTools icon.
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
  if (changeInfo.url && isRestrictedBrowserPage(changeInfo.url)) {
    setExtensionIconAndPopup('restricted', tabId);
  }
});

Domain

Subdomains

Frequently Asked Questions

What does tabsManager.js do?
tabsManager.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in tabsManager.js?
tabsManager.js defines 2 function(s): checkAndHandleRestrictedPageIfSo, isRestrictedBrowserPage.
What does tabsManager.js depend on?
tabsManager.js imports 2 module(s): setExtensionIconAndPopup, setExtensionIconAndPopup.js.
What files import tabsManager.js?
tabsManager.js is imported by 1 file(s): index.js.
Where is tabsManager.js in the architecture?
tabsManager.js is located at packages/react-devtools-extensions/src/background/tabsManager.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-extensions/src/background).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free