mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
@@ -23,16 +23,27 @@ export class SimpleBrowserManager {
|
||||
if (this._activeView) {
|
||||
this._activeView.show(url, options);
|
||||
} else {
|
||||
const view = new SimpleBrowserView(this.extensionUri, url, options);
|
||||
view.onDispose(() => {
|
||||
if (this._activeView === view) {
|
||||
this._activeView = undefined;
|
||||
}
|
||||
});
|
||||
const view = SimpleBrowserView.create(this.extensionUri, url, options);
|
||||
this.registerWebviewListeners(view);
|
||||
|
||||
this._activeView = view;
|
||||
}
|
||||
}
|
||||
|
||||
public restore(panel: vscode.WebviewPanel, state: any): void {
|
||||
const url = state?.url ?? '';
|
||||
const view = SimpleBrowserView.restore(this.extensionUri, url, panel);
|
||||
this.registerWebviewListeners(view);
|
||||
return;
|
||||
}
|
||||
|
||||
private registerWebviewListeners(view: SimpleBrowserView) {
|
||||
view.onDispose(() => {
|
||||
if (this._activeView === view) {
|
||||
this._activeView = undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user