Skip to content

Commit f968b61

Browse files
fix: Refactor import statement and improve code formatting in index.ts
1 parent c1c17ab commit f968b61

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

src/index.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
type BrowserWindowConstructorOptions,
1616
} from 'electron';
1717
import {
18-
enhanceWebRequest,
18+
default as enhanceWebRequest,
1919
type BetterSession,
2020
} from '@jellybrick/electron-better-web-request';
2121
import is from 'electron-is';
@@ -336,8 +336,8 @@ async function createMainWindow() {
336336
titleBarStyle: useInlineMenu
337337
? 'hidden'
338338
: is.macOS()
339-
? 'hiddenInset'
340-
: 'default',
339+
? 'hiddenInset'
340+
: 'default',
341341
autoHideMenuBar: config.get('options.hideMenu'),
342342
};
343343

@@ -533,8 +533,8 @@ app.once('browser-window-created', (_event, win) => {
533533
const updatedUserAgent = is.macOS()
534534
? userAgents.mac
535535
: is.windows()
536-
? userAgents.windows
537-
: userAgents.linux;
536+
? userAgents.windows
537+
: userAgents.linux;
538538

539539
win.webContents.userAgent = updatedUserAgent;
540540
app.userAgentFallback = updatedUserAgent;
@@ -956,17 +956,16 @@ function removeContentSecurityPolicy(
956956
betterSession.webRequest.setResolver(
957957
'onHeadersReceived',
958958
async (listeners) => {
959-
return listeners.reduce(
960-
async (accumulator, listener) => {
961-
const acc = await accumulator;
962-
if (acc.cancel) {
963-
return acc;
964-
}
959+
return listeners.reduce(async (accumulator, listener) => {
960+
const acc = await accumulator;
961+
if (acc.cancel) {
962+
return acc;
963+
}
965964

966-
const result = await listener.apply();
967-
return { ...accumulator, ...result };
968-
},
969-
Promise.resolve({ cancel: false }),
965+
const result = await listener.apply();
966+
return { ...accumulator, ...result };
967+
},
968+
Promise.resolve({ cancel: false }),
970969
);
971970
},
972971
);

0 commit comments

Comments
 (0)