 propTypes() {
    return {
      iframeURL: PropTypes.string.isRequired,
      onExtensionPageMount: PropTypes.func.isRequired,
      onExtensionPageUnmount: PropTypes.func.isRequired,
    };
  }

  constructor(props) {
    super(props);

    this.iframeRef = createRef();
  }

  componentDidMount() {
    this.props.onExtensionPageMount(this.iframeRef.current);
  }

  componentWillUnmount() {
    this.props.onExtensionPageUnmount(this.iframeRef.current);
  }

  render() {
    return dom.iframe({
      className: "inspector-extension-sidebar-page",
      src: this.props.iframeURL,
      style: {
        width: "100%",
        height: "100%",
        margin: 0,
        padding: 0,
      },
      ref: this.iframeRef,
    });
  }
}

module.exports = ExtensionPage;
PK