This commit is contained in:
Benjamin Pasero
2025-12-19 14:32:05 +01:00
parent 077294bf9c
commit 97e1fada1a
2 changed files with 7 additions and 4 deletions

View File

@@ -413,16 +413,15 @@ export class CodeApplication extends Disposable {
this.auxiliaryWindowsMainService?.registerWindow(contents);
}
// Block any in-page navigation
// Handle any in-page navigation
contents.on('will-navigate', event => {
// Allow navigation in integrated browser views
if (BrowserViewMainService.isBrowserViewWebContents(contents)) {
return;
return; // Allow navigation in integrated browser views
}
this.logService.error('webContents#will-navigate: Prevented webcontent navigation');
event.preventDefault();
event.preventDefault(); // Prevent any in-page navigation
});
// All Windows: only allow about:blank auxiliary windows to open

View File

@@ -164,6 +164,10 @@ export class BrowserEditorInput extends EditorInput {
return this._model ? this._model.url : this._initialData.url;
}
override canReopen(): boolean {
return false;
}
override matches(otherInput: EditorInput | IUntypedEditorInput): boolean {
if (super.matches(otherInput)) {
return true;