From 8f2ed3039a5f30eeaf372afc4bcb1105b080bee9 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 16 Dec 2021 19:29:09 +0200 Subject: [PATCH] add comment to useragent fix --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 6fcd2aa1..c1437847 100644 --- a/index.js +++ b/index.js @@ -183,6 +183,7 @@ app.once("browser-window-created", (event, win) => { app.userAgentFallback = updatedUserAgent; win.webContents.session.webRequest.onBeforeSendHeaders((details, cb) => { + // this will only happen if login failed, and "retry" was pressed if (win.webContents.getURL().startsWith("https://accounts.google.com") && details.url.startsWith("https://accounts.google.com")){ details.requestHeaders["User-Agent"] = originalUserAgent; }