diff options
Diffstat (limited to 'recipes/google-calendar/webview.js')
-rw-r--r-- | recipes/google-calendar/webview.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/recipes/google-calendar/webview.js b/recipes/google-calendar/webview.js new file mode 100644 index 0000000..3921dea --- /dev/null +++ b/recipes/google-calendar/webview.js | |||
@@ -0,0 +1,18 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
7 | module.exports = Ferdium => { | ||
8 | // if the user is on googlecalendar landing page, go to the login page. | ||
9 | if ( | ||
10 | location.hostname === 'workspace.google.com' && | ||
11 | location.href.includes('products/calendar/') | ||
12 | ) { | ||
13 | location.href = | ||
14 | 'https://accounts.google.com/AccountChooser?continue=https://calendar.google.com/u/0/'; | ||
15 | } | ||
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'calendar.css')); | ||
17 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | ||
18 | }; | ||