@yuebai008/cli
Version:
Command line interface for rapid qg-minigame development
1 lines • 1.09 kB
JavaScript
import*as Common from"../../core/common/common.js";import*as SDK from"../../core/sdk/sdk.js";import*as UI from"../../ui/legacy/legacy.js";import{NetworkGroupNode}from"./NetworkDataGridNode.js";export class NetworkFrameGrouper{parentView;activeGroups;constructor(e){this.parentView=e,this.activeGroups=new Map}groupNodeForRequest(e){const r=SDK.ResourceTreeModel.ResourceTreeModel.frameForRequest(e);if(!r||r.isOutermostFrame())return null;let o=this.activeGroups.get(r);return o||(o=new FrameGroupNode(this.parentView,r),this.activeGroups.set(r,o),o)}reset(){this.activeGroups.clear()}}export class FrameGroupNode extends NetworkGroupNode{frame;constructor(e,r){super(e),this.frame=r}displayName(){return new Common.ParsedURL.ParsedURL(this.frame.url).domain()||this.frame.name||"<iframe>"}renderCell(e,r){super.renderCell(e,r);if(0===this.dataGrid.indexOfVisibleColumn(r)){const o=this.displayName();e.appendChild(UI.Icon.Icon.create("frame","network-frame-group-icon")),UI.UIUtils.createTextChild(e,o),UI.Tooltip.Tooltip.install(e,o),this.setCellAccessibleName(e.textContent||"",e,r)}}}