import*as UI from"../ui/ui.js";export class RequestHTMLView extends UI.Widget.VBox{constructor(e){super(!0),this.registerRequiredCSS("network/requestHTMLView.css",{enableLegacyPatching:!1}),this._dataURL=encodeURI(e).replace(/#/g,"%23"),this.contentElement.classList.add("html","request-view")}wasShown(){this._createIFrame()}willHide(){this.contentElement.removeChildren()}_createIFrame(){this.contentElement.removeChildren();const e=document.createElement("iframe");e.className="html-preview-frame",e.setAttribute("sandbox",""),e.setAttribute("src",this._dataURL),e.tabIndex=-1,UI.ARIAUtils.markAsPresentation(e),this.contentElement.appendChild(e)}}