ademilter / Frame

New-tab extension for Chrome and Firefox
91 stars 12 forks source link

Notifications shouldn't be inside of the Vue app #21

Open canova opened 6 years ago

canova commented 6 years ago

Currently notification code lives under tab content side inside Vue app. Because of that, if there is an event in one hour, I'm getting the same notification whenever I open a new tab. And this is quite disturbing. I would want it to see once, not everytime I open a new tab. I think we should create a background script for the extension and check the events there every minute. (And we should use chrome.notifications.create inside the backround script since the Notification API won't work inside that script.)

We can communicate between background script and Vue app with that API call: chrome.extension.getBackgroundPage().

We can create a background script that checks the events every minute in background script, there is a step by step walk-through here: https://developer.chrome.com/apps/app_codelab_alarms (The only difference, we shouldn't use chrome.app.runtime.onLaunched.addListener and use chrome.extension.getBackgroundPage() to call from Vue app)

I can mentor someone who wants to work on that issue. You can leave a comment here if you want to work on that. I can provide additional information.

ademilter commented 6 years ago

I've disabled it until I make a logical decision