tor-browser

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

RequestListColumnProtocol.js (1175B)


      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 "use strict";
      6 
      7 const {
      8  Component,
      9 } = require("resource://devtools/client/shared/vendor/react.mjs");
     10 const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
     11 const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.mjs");
     12 const {
     13  getFormattedProtocol,
     14 } = require("resource://devtools/client/netmonitor/src/utils/request-utils.js");
     15 
     16 class RequestListColumnProtocol extends Component {
     17  static get propTypes() {
     18    return {
     19      item: PropTypes.object.isRequired,
     20    };
     21  }
     22 
     23  shouldComponentUpdate(nextProps) {
     24    return (
     25      getFormattedProtocol(this.props.item) !==
     26      getFormattedProtocol(nextProps.item)
     27    );
     28  }
     29 
     30  render() {
     31    const protocol = getFormattedProtocol(this.props.item);
     32 
     33    return dom.td(
     34      {
     35        className: "requests-list-column requests-list-protocol",
     36        title: protocol,
     37      },
     38      protocol
     39    );
     40  }
     41 }
     42 
     43 module.exports = RequestListColumnProtocol;