mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Merge pull request #595 from Araxeus/useragent-option
make useragent override optional
This commit is contained in:
3
index.js
3
index.js
@ -221,6 +221,7 @@ function createMainWindow() {
|
||||
}
|
||||
|
||||
app.once("browser-window-created", (event, win) => {
|
||||
if (config.get("options.overrideUserAgent")) {
|
||||
// User agents are from https://developers.whatismybrowser.com/useragents/explore/
|
||||
const originalUserAgent = win.webContents.userAgent;
|
||||
const userAgents = {
|
||||
@ -244,7 +245,7 @@ app.once("browser-window-created", (event, win) => {
|
||||
}
|
||||
cb({ requestHeaders: details.requestHeaders });
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
setupSongInfo(win);
|
||||
loadPlugins(win);
|
||||
|
||||
8
menu.js
8
menu.js
@ -187,6 +187,14 @@ const mainMenuTemplate = (win) => {
|
||||
setProxy(item, win);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Override useragent",
|
||||
type: "checkbox",
|
||||
checked: config.get("options.overrideUserAgent"),
|
||||
click: (item) => {
|
||||
config.setMenuOption("options.overrideUserAgent", item.checked);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Disable hardware acceleration",
|
||||
type: "checkbox",
|
||||
|
||||
Reference in New Issue
Block a user