[MM-23057] add different useragent for popup windows (#1247)

This commit is contained in:
Guillermo Vayá
2020-04-02 17:39:29 +02:00
committed by GitHub
parent faeab18a0e
commit adaeea2082

View File

@@ -86,6 +86,18 @@ const customLoginRegexPaths = [
// tracking in progress custom logins // tracking in progress custom logins
const customLogins = {}; const customLogins = {};
const nixUA = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome Safari/537.36';
const popupUserAgent = {
darwin: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome Safari/537.36',
win32: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome Safari/537.36',
aix: nixUA,
freebsd: nixUA,
linux: nixUA,
openbsd: nixUA,
sunos: nixUA,
};
/** /**
* Main entry point for the application, ensures that everything initializes in the proper order * Main entry point for the application, ensures that everything initializes in the proper order
*/ */
@@ -525,7 +537,12 @@ function handleAppWebContentsCreated(dc, contents) {
popupWindow = null; popupWindow = null;
}); });
} }
popupWindow.loadURL(url);
// currently changing the userAgent for popup windows to allow plugins to go through google's oAuth
// should be removed once a proper oAuth2 implementation is setup.
popupWindow.loadURL(url, {
userAgent: popupUserAgent[process.platform],
});
} }
}); });