Skip to content

Commit e1ec066

Browse files
very real user agent (#495)
1 parent 3a6fa38 commit e1ec066

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/background.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { app, Event as ElectronEvent, ipcMain, ipcRenderer, shell } from "electron";
1+
import {
2+
app,
3+
Event as ElectronEvent,
4+
ipcMain,
5+
ipcRenderer,
6+
shell,
7+
} from "electron";
28
import { BrowserWindow } from "electron/main";
39
import path from "path";
410
import process from "process";
@@ -100,10 +106,12 @@ if (gotTheLock) {
100106
// Specifically, we are ONLY removing the Electron portion of the agent
101107
// Found via https://old.reddit.com/r/electronjs/comments/eiy2sf/google_blocking_log_in_from_electron_apps/fcvuwd9/
102108
// Referenced at this link https://github.com/firebase/firebase-js-sdk/issues/2478#issuecomment-571773318
103-
"User-Agent": mainWindow.webContents.userAgent.replace(
104-
"Electron/" + process.versions.electron,
105-
""
106-
),
109+
// "User-Agent": mainWindow.webContents.userAgent.replace(
110+
// "Electron/" + process.versions.electron,
111+
// ""
112+
// ),
113+
"User-Agent":
114+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/2000.36 (KHTML, like Gecko) Chrome/2000.0.0.0 Safari/2000.36",
107115
},
108116
})
109117
);
@@ -198,7 +206,9 @@ if (gotTheLock) {
198206
});
199207

200208
ipcMain.handle("get-icon", () => {
201-
var bitmap = fs.readFileSync(path.resolve(RESOURCES_PATH, "icons", "64x64.png"));
202-
return Buffer.from(bitmap).toString('base64');
203-
})
209+
var bitmap = fs.readFileSync(
210+
path.resolve(RESOURCES_PATH, "icons", "64x64.png")
211+
);
212+
return Buffer.from(bitmap).toString("base64");
213+
});
204214
}

0 commit comments

Comments
 (0)