fix: type internal APIs that can return null properly (#29852)
This commit is contained in:
parent
461db8f1ab
commit
a545cd3790
6 changed files with 12 additions and 12 deletions
|
@ -144,7 +144,7 @@ function emitDeprecatedNewWindowEvent ({ event, embedder, guest, windowOpenArgs,
|
|||
postData?: PostData,
|
||||
}): boolean {
|
||||
const { url, frameName } = windowOpenArgs;
|
||||
const isWebViewWithPopupsDisabled = embedder.getType() === 'webview' && embedder.getLastWebPreferences().disablePopups;
|
||||
const isWebViewWithPopupsDisabled = embedder.getType() === 'webview' && embedder.getLastWebPreferences()!.disablePopups;
|
||||
const postBody = postData ? {
|
||||
data: postData,
|
||||
...parseContentTypeFormat(postData)
|
||||
|
@ -229,7 +229,7 @@ export function makeWebPreferences ({ embedder, secureOverrideWebPreferences = {
|
|||
// have unvetted prefs, use parsedWebPreferences.
|
||||
secureOverrideWebPreferences?: BrowserWindowConstructorOptions['webPreferences'],
|
||||
}) {
|
||||
const parentWebPreferences = embedder.getLastWebPreferences();
|
||||
const parentWebPreferences = embedder.getLastWebPreferences()!;
|
||||
const securityWebPreferencesFromParent = (Object.keys(securityWebPreferences).reduce((map, key) => {
|
||||
if (securityWebPreferences[key] === parentWebPreferences[key as keyof Electron.WebPreferences]) {
|
||||
(map as any)[key] = parentWebPreferences[key as keyof Electron.WebPreferences];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue