diff options
Diffstat (limited to 'recipes/google-calendar')
-rw-r--r-- | recipes/google-calendar/package.json | 2 | ||||
-rw-r--r-- | recipes/google-calendar/webview.js | 31 |
2 files changed, 30 insertions, 3 deletions
diff --git a/recipes/google-calendar/package.json b/recipes/google-calendar/package.json index 79e94fe..a7dc23a 100644 --- a/recipes/google-calendar/package.json +++ b/recipes/google-calendar/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "google-calendar", | 2 | "id": "google-calendar", |
3 | "name": "Google Calendar", | 3 | "name": "Google Calendar", |
4 | "version": "2.4.0", | 4 | "version": "2.4.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "aliases": [ | 6 | "aliases": [ |
7 | "google-calendar", | 7 | "google-calendar", |
diff --git a/recipes/google-calendar/webview.js b/recipes/google-calendar/webview.js index 3921dea..804527d 100644 --- a/recipes/google-calendar/webview.js +++ b/recipes/google-calendar/webview.js | |||
@@ -13,6 +13,33 @@ module.exports = Ferdium => { | |||
13 | location.href = | 13 | location.href = |
14 | 'https://accounts.google.com/AccountChooser?continue=https://calendar.google.com/u/0/'; | 14 | 'https://accounts.google.com/AccountChooser?continue=https://calendar.google.com/u/0/'; |
15 | } | 15 | } |
16 | Ferdium.injectCSS(_path.default.join(__dirname, 'calendar.css')); | 16 | |
17 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 17 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); |
18 | Ferdium.injectCSS( | ||
19 | 'https://cdn.statically.io/gh/ferdium/ferdium-recipes/main/recipes/google-calendar/calendar.css', | ||
20 | ); | ||
21 | Ferdium.injectJSUnsafe( | ||
22 | 'https://cdn.statically.io/gh/ferdium/ferdium-recipes/main/recipes/google-calendar/webview-unsave.js', | ||
23 | ); | ||
24 | |||
25 | Ferdium.handleDarkMode(isEnabled => { | ||
26 | const cssId = 'cssDarkModeWorkaround'; | ||
27 | |||
28 | if (isEnabled) { | ||
29 | // Workaround for loading darkmode.css | ||
30 | if (!document.querySelector(`#${cssId}`)) { | ||
31 | const head = document.querySelectorAll('head')[0]; | ||
32 | const link = document.createElement('link'); | ||
33 | link.id = cssId; | ||
34 | link.rel = 'stylesheet'; | ||
35 | link.type = 'text/css'; | ||
36 | link.href = | ||
37 | 'https://cdn.statically.io/gh/ferdium/ferdium-recipes/main/recipes/google-calendar/darkmode.css'; | ||
38 | link.media = 'all'; | ||
39 | head.append(link); | ||
40 | } | ||
41 | } else { | ||
42 | document.querySelector(`#${cssId}`)?.remove(); | ||
43 | } | ||
44 | }); | ||
18 | }; | 45 | }; |