Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ export class BrowserViewMainService extends Disposable implements IBrowserViewMa

// Request the workbench to open the editor
this.windowsMainService.sendToFocused('vscode:runAction', {
id: 'vscode.open',
args: [BrowserViewUri.forUrl(url, targetId)]
id: '_workbench.open',
args: [BrowserViewUri.forUrl(url, targetId), [undefined, { preserveFocus: true }], undefined]
});
Comment thread
kycutler marked this conversation as resolved.

return view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ export class BrowserEditor extends EditorPane {
this._inputDisposables.clear();

// Resolve the browser view model from the input
this._model = await input.resolve();
const model = await input.resolve();
this._model = model;
if (token.isCancellationRequested || this.input !== input) {
return;
}
Expand Down Expand Up @@ -425,12 +426,16 @@ export class BrowserEditor extends EditorPane {
});
this.setBackgroundImage(this._model.screenshot);

if (context.newInGroup) {
if (this._model.url) {
this._browserContainer.focus();
} else {
this.focusUrlInput();
}
if (!options?.preserveFocus) {
setTimeout(() => {
if (this._model === model) {
if (this._model.url) {
this._browserContainer.focus();
} else {
this.focusUrlInput();
}
}
}, 0);
}

// Start / stop screenshots when the model visibility changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class BrowserFindWidget extends SimpleFindWidget {

// Stop find and clear highlights in the browser view
this._model?.stopFindInPage(true);
this._model?.focus();
this._lastFindResult = undefined;
this._hasFoundMatch = false;
}
Expand Down
Loading