Skip to content

Commit 766d321

Browse files
committed
Persistance check should not activate background webview extensions
Fixes microsoft#95615 When checking if we can persist a webview, we check to see if any reviver is registered for it. However this may activate extensions that register the reviver For background webview that have been restored we can skip this check since we know they were persisted in the past
1 parent 89bc8d2 commit 766d321

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/workbench/contrib/webview/browser/webviewWorkbenchService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ export class WebviewEditorService implements IWebviewWorkbenchService {
267267
public shouldPersist(
268268
webview: WebviewInput
269269
): boolean {
270-
if (Iterable.some(this._revivers.values(), reviver => canRevive(reviver, webview))) {
270+
// Revived webviews may not have an actively registered reviver but we still want to presist them
271+
// since a reviver should exist when it is actually needed.
272+
if (webview instanceof LazilyResolvedWebviewEditorInput) {
271273
return true;
272274
}
273275

274-
// Revived webviews may not have an actively registered reviver but we still want to presist them
275-
// since a reviver should exist when it is actually needed.
276-
return webview instanceof LazilyResolvedWebviewEditorInput;
276+
return Iterable.some(this._revivers.values(), reviver => canRevive(reviver, webview));
277277
}
278278

279279
private async tryRevive(

0 commit comments

Comments
 (0)