mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
fix: Added Min height and width to the window which doesnt breaks the UI responsiveness (#3602)
This commit is contained in:
29
src/index.ts
29
src/index.ts
@ -338,8 +338,8 @@ async function createMainWindow() {
|
|||||||
titleBarStyle: useInlineMenu
|
titleBarStyle: useInlineMenu
|
||||||
? 'hidden'
|
? 'hidden'
|
||||||
: is.macOS()
|
: is.macOS()
|
||||||
? 'hiddenInset'
|
? 'hiddenInset'
|
||||||
: 'default',
|
: 'default',
|
||||||
autoHideMenuBar: config.get('options.hideMenu'),
|
autoHideMenuBar: config.get('options.hideMenu'),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -353,6 +353,8 @@ async function createMainWindow() {
|
|||||||
icon,
|
icon,
|
||||||
width: windowSize.width,
|
width: windowSize.width,
|
||||||
height: windowSize.height,
|
height: windowSize.height,
|
||||||
|
minWidth: 325,
|
||||||
|
minHeight: 425,
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
show: false,
|
show: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@ -527,8 +529,8 @@ app.once('browser-window-created', (_event, win) => {
|
|||||||
const updatedUserAgent = is.macOS()
|
const updatedUserAgent = is.macOS()
|
||||||
? userAgents.mac
|
? userAgents.mac
|
||||||
: is.windows()
|
: is.windows()
|
||||||
? userAgents.windows
|
? userAgents.windows
|
||||||
: userAgents.linux;
|
: userAgents.linux;
|
||||||
|
|
||||||
win.webContents.userAgent = updatedUserAgent;
|
win.webContents.userAgent = updatedUserAgent;
|
||||||
app.userAgentFallback = updatedUserAgent;
|
app.userAgentFallback = updatedUserAgent;
|
||||||
@ -949,18 +951,15 @@ function removeContentSecurityPolicy(
|
|||||||
betterSession.webRequest.setResolver(
|
betterSession.webRequest.setResolver(
|
||||||
'onHeadersReceived',
|
'onHeadersReceived',
|
||||||
async (listeners) => {
|
async (listeners) => {
|
||||||
return listeners.reduce(
|
return listeners.reduce(async (accumulator, listener) => {
|
||||||
async (accumulator, listener) => {
|
const acc = await accumulator;
|
||||||
const acc = await accumulator;
|
if (acc.cancel) {
|
||||||
if (acc.cancel) {
|
return acc;
|
||||||
return acc;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const result = await listener.apply();
|
const result = await listener.apply();
|
||||||
return { ...accumulator, ...result };
|
return { ...accumulator, ...result };
|
||||||
},
|
}, Promise.resolve({ cancel: false }));
|
||||||
Promise.resolve({ cancel: false }),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user