Skip to content

Commit

Permalink
Fix ytmdesktop#185
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerluiz committed Aug 26, 2020
1 parent 8fcea90 commit b0e6a5d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,24 @@ function createWindow() {
}

mainWindow = new BrowserWindow(browserWindowConfig)
mainWindow.webContents.session.setUserAgent(
`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${process.versions.chrome} Safari/537.36`

mainWindow.webContents.session.webRequest.onBeforeSendHeaders(
{
urls: ['https://accounts.google.com/*'],
},
(details, callback) => {
const newRequestHeaders = Object.assign(
{},
details.requestHeaders || {},
{
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0',
}
)
callback({ requestHeaders: newRequestHeaders })
}
)

view = new BrowserView({
webPreferences: {
nodeIntegration: true,
Expand Down

0 comments on commit b0e6a5d

Please sign in to comment.