Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Commit

Permalink
Fix: Google login issue "You are trying to sign in from a browser or …
Browse files Browse the repository at this point in the history
…app that doesn't allow us to keep your account secure"

Fixes: #2495
  • Loading branch information
fvulich committed Dec 6, 2019
1 parent ad0f70a commit 83e7fd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/ux/WebView.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ Ext.define('Rambox.ux.WebView',{
// Show and hide spinner when is loading
webview.addEventListener("did-start-loading", function() {
console.info('Start loading...', me.src);

webview.getWebContents().session.webRequest.onBeforeSendHeaders((details, callback) => {
let googleLoginURLs = ['accounts.google.com/signin/oauth', 'accounts.google.com/ServiceLogin']
googleLoginURLs.forEach((loginURL) => { if ( details.url.indexOf(loginURL) > -1 ) details.requestHeaders['User-Agent'] = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0'; })
callback({ cancel: false, requestHeaders: details.requestHeaders });
});

if ( !me.down('statusbar').closed || !me.down('statusbar').keep ) me.down('statusbar').show();
me.down('statusbar').showBusy();
});
Expand Down

1 comment on commit 83e7fd3

@knw257
Copy link

@knw257 knw257 commented on 83e7fd3 Jan 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to fix the issue on google voice - recommend adding voice.google.com to the googleLoginURLs

Please sign in to comment.