{"size": 1087, "ext": "js", "max_stars_repo_path": "public/front_end/extensions/ExtensionView.js", "max_stars_repo_name": "xueduany/chii", "max_stars_repo_stars_event_min_datetime": "2021-03-04T09:24:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-04T09:24:45.000Z", "max_issues_repo_path": "public/front_end/extensions/ExtensionView.js", "max_issues_repo_name": "xueduany/chii", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/front_end/extensions/ExtensionView.js", "max_forks_repo_name": "xueduany/chii", "max_forks_repo_forks_event_min_datetime": "2021-03-04T09:25:23.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-07T03:48:28.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 1087.0, "max_line_length": 1087, "alphanum_fraction": 0.8114075437}
import*as UI from"../ui/ui.js";import{ExtensionServer}from"./ExtensionServer.js";export class ExtensionView extends UI.Widget.Widget{constructor(e,i,t,s){super(),this.setHideOnDetach(),this.element.className="vbox flex-auto",this.element.tabIndex=-1,this._server=e,this._id=i,this._iframe=createElement("iframe"),this._iframe.addEventListener("load",this._onLoad.bind(this),!1),this._iframe.src=t,this._iframe.className=s,this.setDefaultFocusedElement(this.element),this.element.appendChild(this._iframe)}wasShown(){"number"==typeof this._frameIndex&&this._server.notifyViewShown(this._id,this._frameIndex)}willHide(){"number"==typeof this._frameIndex&&this._server.notifyViewHidden(this._id)}_onLoad(){const e=window.frames;this._frameIndex=Array.prototype.indexOf.call(e,this._iframe.contentWindow),this.isShowing()&&this._server.notifyViewShown(this._id,this._frameIndex)}}export class ExtensionNotifierView extends UI.Widget.VBox{constructor(e,i){super(),this._server=e,this._id=i}wasShown(){this._server.notifyViewShown(this._id)}willHide(){this._server.notifyViewHidden(this._id)}}