drawPanel = () => {
  chrome.devtools.panels.create('React-Sight', '', 'devtools.html', () => {
    addListeners();
    const port = chrome.runtime.connect({ name: 'React-Sight' });

    // establishes a connection between devtools and background page
    port.postMessage({
      name: 'connect',
      tabId: chrome.devtools.inspectedWindow.tabId,
    });

    drawLoadingScreen();

    // Listens for posts sent in specific ports and redraws tree
    port.onMessage.addListener((msg) => {
      if (!msg.data) return; // abort if data not present, or if not of type object
      if (typeof msg !== 'object') return;
      curData = msg; // assign global data object
      throttledDraw();
    });
  });
}
Add panel to chrome dev tools and initialize port and listener