aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2024-04-09 23:47:47 +0100
committerLibravatar GitHub <noreply@github.com>2024-04-09 23:47:47 +0100
commit099f02943602d42d42bc20fd173f81af7da40625 (patch)
tree204ab2cb92783cd632be4c5b2a374f27c711621c
parentBump tj-actions/changed-files from 42 to 44 (#523) (diff)
downloadferdium-recipes-099f02943602d42d42bc20fd173f81af7da40625.tar.gz
ferdium-recipes-099f02943602d42d42bc20fd173f81af7da40625.tar.zst
ferdium-recipes-099f02943602d42d42bc20fd173f81af7da40625.zip
Fix notion calendar login (#529)
-rw-r--r--recipes/notion-calendar/package.json2
-rw-r--r--recipes/notion-calendar/webview-unsafe.js7
-rw-r--r--recipes/notion-calendar/webview.js8
3 files changed, 9 insertions, 8 deletions
diff --git a/recipes/notion-calendar/package.json b/recipes/notion-calendar/package.json
index 672c823..1f41789 100644
--- a/recipes/notion-calendar/package.json
+++ b/recipes/notion-calendar/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "notion-calendar", 2 "id": "notion-calendar",
3 "name": "Notion Calendar", 3 "name": "Notion Calendar",
4 "version": "1.0.0", 4 "version": "1.0.1",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://calendar.notion.so/", 7 "serviceURL": "https://calendar.notion.so/",
diff --git a/recipes/notion-calendar/webview-unsafe.js b/recipes/notion-calendar/webview-unsafe.js
new file mode 100644
index 0000000..f028f4c
--- /dev/null
+++ b/recipes/notion-calendar/webview-unsafe.js
@@ -0,0 +1,7 @@
1// Workaround for Notion's login window with Google OAuth
2if (window.location.href === 'https://calendar.notion.so/login') {
3 window.open = function (url) {
4 const newUrl = url.replace('popup=true', 'popup=false');
5 window.location.href = newUrl;
6 };
7}
diff --git a/recipes/notion-calendar/webview.js b/recipes/notion-calendar/webview.js
index 2a81dec..c27c226 100644
--- a/recipes/notion-calendar/webview.js
+++ b/recipes/notion-calendar/webview.js
@@ -5,12 +5,6 @@ function _interopRequireDefault(obj) {
5const _path = _interopRequireDefault(require('path')); 5const _path = _interopRequireDefault(require('path'));
6 6
7module.exports = Ferdium => { 7module.exports = Ferdium => {
8 // TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges
9 // const getMessages = () => {
10 // // TODO: Insert your notification-finding code here
11 // Ferdium.setBadge(0, 0);
12 // };
13 // Ferdium.loop(getMessages);
14
15 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); 8 Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
9 Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js'));
16}; 10};