-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.js
31 lines (28 loc) · 1.09 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module.exports = Franz => class Gmail extends Franz {
modifyRequestHeaders() {
return [{
headers: {
origin: 'RefererHost',
},
requestFilters: {
urls: [
'*://people-pa.clients6.google.com/*', '*://clients6.google.com/drive/*', '*://clients6.google.com/gmail/*', '*://signaler-pa.clients6.google.com/*', '*://addons-pa.clients6.google.com/*',
'*://chat-pa.clients6.google.com/*', '*://clients6.google.com/voice/*', '*://hangouts.google.com/*',
'*://peoplestack-pa.clients6.google.com/*', '*://calendar-pa.clients6.google.com/*', '*://play.google.com/*'],
},
}];
}
eventDidLoad(serviceBrowserView, event, url) {
this.userAgentHack(serviceBrowserView.webContents, url);
}
eventWillNavigate(serviceBrowserView, event, url) {
this.userAgentHack(serviceBrowserView.webContents, url);
}
userAgentHack(webContents, url) {
if (url.startsWith('https://accounts.google.com')) {
webContents.setUserAgent(this.mockUserAgent(true));
} else {
webContents.setUserAgent(this.mockUserAgent(false));
}
}
};