Skip to content

Commit

Permalink
Fix notion calendar login
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecialAro committed Apr 9, 2024
1 parent 90dd011 commit e88a882
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion recipes/notion-calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "notion-calendar",
"name": "Notion Calendar",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",
"config": {
"serviceURL": "https://calendar.notion.so/",
Expand Down
8 changes: 8 additions & 0 deletions recipes/notion-calendar/webview-unsafe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Workaround for Notion's login window with Google OAuth
if (window.location.href === 'https://calendar.notion.so/login') {
window.open = function (url) {
const newUrl = url.replace('popup=true', 'popup=false');
window.location.href = newUrl;
};
console.log('FERDIUM: Overriding window.open for Google OAuth login window in Notion.')

Check warning on line 7 in recipes/notion-calendar/webview-unsafe.js

View workflow job for this annotation

GitHub Actions / Ferdium Recipes Build

Unexpected console statement
}
10 changes: 2 additions & 8 deletions recipes/notion-calendar/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ function _interopRequireDefault(obj) {

const _path = _interopRequireDefault(require('path'));

module.exports = Ferdium => {
// TODO: If your SNAME service has unread messages, uncomment these lines to implement the logic for updating the badges
// const getMessages = () => {
// // TODO: Insert your notification-finding code here
// Ferdium.setBadge(0, 0);
// };
// Ferdium.loop(getMessages);

module.exports = (Ferdium) => {
Ferdium.injectCSS(_path.default.join(__dirname, 'service.css'));
Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js'));
};

0 comments on commit e88a882

Please sign in to comment.