diff --git a/src/main/browser/extensions/browser-extension-management.test.ts b/src/main/browser/extensions/browser-extension-management.test.ts index 83b8157d6d3..745d91a9016 100644 --- a/src/main/browser/extensions/browser-extension-management.test.ts +++ b/src/main/browser/extensions/browser-extension-management.test.ts @@ -48,6 +48,7 @@ vi.mock('./profile-sessions/browser-extension-session-loader', () => ({ _profile: string, _id: string, run: (session: Electron.Session) => Promise + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this fixture operation callback does not use native session members. ) => run({} as Electron.Session), hasBrowserExtensionProfileDemand: () => true, getBrowserExtensionSessionForProfile: vi.fn(), diff --git a/src/main/browser/extensions/installation/browser-extension-webstore-install.test.ts b/src/main/browser/extensions/installation/browser-extension-webstore-install.test.ts index 08ab2eedc32..c4e61197b0c 100644 --- a/src/main/browser/extensions/installation/browser-extension-webstore-install.test.ts +++ b/src/main/browser/extensions/installation/browser-extension-webstore-install.test.ts @@ -46,6 +46,7 @@ vi.mock('../profile-sessions/browser-extension-session-loader', () => ({ _profile: string, _id: string, run: (session: Electron.Session) => Promise + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this fixture operation callback does not use native session members. ) => run({} as Electron.Session), hasBrowserExtensionProfileDemand: () => true, getBrowserExtensionSessionForProfile: (profileId: string) => diff --git a/src/main/browser/extensions/permissions/browser-extension-settings-prompt-lifetime.test.ts b/src/main/browser/extensions/permissions/browser-extension-settings-prompt-lifetime.test.ts index 1c3ae25cd02..9ac4a0b8f1f 100644 --- a/src/main/browser/extensions/permissions/browser-extension-settings-prompt-lifetime.test.ts +++ b/src/main/browser/extensions/permissions/browser-extension-settings-prompt-lifetime.test.ts @@ -36,6 +36,7 @@ vi.mock('../profile-sessions/browser-extension-session-loader', () => ({ _profile: string, _id: string, run: (session: Electron.Session) => Promise + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this fixture operation callback does not use native session members. ) => run({} as Electron.Session), hasBrowserExtensionProfileDemand: () => true, getBrowserExtensionSessionForProfile: () => ({}), diff --git a/src/main/browser/extensions/profile-sessions/browser-extension-session-loader.test.ts b/src/main/browser/extensions/profile-sessions/browser-extension-session-loader.test.ts index 0c12f3a1f2f..674b09c0962 100644 --- a/src/main/browser/extensions/profile-sessions/browser-extension-session-loader.test.ts +++ b/src/main/browser/extensions/profile-sessions/browser-extension-session-loader.test.ts @@ -440,6 +440,7 @@ it('reuses completed full maintenance until the install store changes, and scope it('skips repeated no-worker cleanup only after completion and invalidates it for every worker generation', async () => { const { refreshWorkerRegistration } = await import('./browser-extension-worker-registration') const clearStorageData = vi.fn(async () => {}) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: worker registration cleanup only calls the provided clearStorageData method. const session = { clearStorageData } as unknown as Electron.Session const prepared = { extensionId: 'b'.repeat(32), diff --git a/src/main/window/security/main-window-webview-security.ts b/src/main/window/security/main-window-webview-security.ts index 86b4fe4869b..b92c3bdca10 100644 --- a/src/main/window/security/main-window-webview-security.ts +++ b/src/main/window/security/main-window-webview-security.ts @@ -100,11 +100,11 @@ export function installMainWindowWebviewSecurity(mainWindow: BrowserWindow): voi { url: string; options: Electron.LoadURLOptions } >() const captureInitialNavigation = (_event: Electron.Event, guest: Electron.WebContents): void => { - const arguments_ = - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Electron WebContents exposes getLastWebPreferences at runtime; its public type omits it. - ( - guest as Electron.WebContents & { getLastWebPreferences: () => Electron.WebPreferences } - ).getLastWebPreferences()?.additionalArguments ?? [] + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Electron WebContents exposes getLastWebPreferences at runtime; its public type omits it. + const nativeGuest = guest as Electron.WebContents & { + getLastWebPreferences: () => Electron.WebPreferences + } + const arguments_ = nativeGuest.getLastWebPreferences()?.additionalArguments ?? [] const marker = arguments_.find((argument) => pendingInitialNavigation.has(argument)) if (!marker) { return