Skip to content

Commit

Permalink
Merge pull request #44 from TanukiPenny/master
Browse files Browse the repository at this point in the history
  • Loading branch information
JustYuuto authored May 20, 2024
2 parents 86a1c28 + 0e2c686 commit 7bf01e1
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/utils/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as DiscordWebSocket from './DiscordWebSocket';
import * as RPC from './RPC';
import { log } from './Log';
import { runJs, wait } from '../functions';
import { BrowserWindow, ipcMain, shell, nativeImage, session, dialog } from 'electron';
import { BrowserWindow, ipcMain, shell, nativeImage, session } from 'electron';
import { setActivity } from './Activity';

export let win: BrowserWindow;
Expand Down Expand Up @@ -43,7 +43,9 @@ export async function load(app: Electron.App) {
await setThumbarButtons();

session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
details.requestHeaders['User-Agent'] = userAgent;
if (details.url.includes('deezer.com')) {
details.requestHeaders['User-Agent'] = userAgent;
}
callback({ cancel: false, requestHeaders: details.requestHeaders });
});

Expand All @@ -60,14 +62,7 @@ export async function load(app: Electron.App) {
});

win.webContents.setWindowOpenHandler((details) => {
if (details.url.includes('accounts.google.com')) {
dialog.showMessageBox({
type: 'warning',
title: 'Google login',
message: 'Google login is broken, if someone knows how to fix it, please open an issue/PR on GitHub. Thanks!'
});
return { action: 'deny' };
} else if (details.url.includes('facebook.com') || details.url.includes('apple.com')) {
if (details.url.includes('facebook.com') || details.url.includes('apple.com') || details.url.includes('accounts.google.com')) {
return {
action: 'allow',
overrideBrowserWindowOptions: {
Expand Down

0 comments on commit 7bf01e1

Please sign in to comment.