mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 12:42:06 +00:00
make useragent override optional
This commit is contained in:
3
index.js
3
index.js
@ -192,6 +192,7 @@ function createMainWindow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.once("browser-window-created", (event, win) => {
|
app.once("browser-window-created", (event, win) => {
|
||||||
|
if (config.get("options.overrideUserAgent")) {
|
||||||
// User agents are from https://developers.whatismybrowser.com/useragents/explore/
|
// User agents are from https://developers.whatismybrowser.com/useragents/explore/
|
||||||
const originalUserAgent = win.webContents.userAgent;
|
const originalUserAgent = win.webContents.userAgent;
|
||||||
const userAgents = {
|
const userAgents = {
|
||||||
@ -215,7 +216,7 @@ app.once("browser-window-created", (event, win) => {
|
|||||||
}
|
}
|
||||||
cb({ requestHeaders: details.requestHeaders });
|
cb({ requestHeaders: details.requestHeaders });
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setupSongInfo(win);
|
setupSongInfo(win);
|
||||||
loadPlugins(win);
|
loadPlugins(win);
|
||||||
|
|||||||
8
menu.js
8
menu.js
@ -174,6 +174,14 @@ const mainMenuTemplate = (win) => {
|
|||||||
setProxy(item, win);
|
setProxy(item, win);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Override useragent",
|
||||||
|
type: "checkbox",
|
||||||
|
checked: config.get("options.overrideUserAgent"),
|
||||||
|
click: (item) => {
|
||||||
|
config.set("options.overrideUserAgent", item.checked);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "Disable hardware acceleration",
|
label: "Disable hardware acceleration",
|
||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
|
|||||||
Reference in New Issue
Block a user