From 69f88ed8403d9d2fa44d61a8a52b8e86514c9c66 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 12 Apr 2020 19:33:45 +0200 Subject: [PATCH] Force user agent for Google OAuth to work --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f7dddafb..a3219f27 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,12 @@ function createMainWindow() { win.maximize(); } - win.webContents.loadURL(store.get("url")); + // Force user-agent "Firefox Windows" for Google OAuth to work + // From https://github.com/firebase/firebase-js-sdk/issues/2478#issuecomment-571356751 + const userAgent = + "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:70.0) Gecko/20100101 Firefox/70.0"; + + win.webContents.loadURL(store.get("url"), { userAgent }); win.on("closed", onClosed); injectCSS(win.webContents, path.join(__dirname, "youtube-music.css"));