nprapps / liveblog-standalone

NPR's liveblog rig 2.0
Other
6 stars 1 forks source link

Test notification support #14

Open thomaswilburn opened 4 years ago

thomaswilburn commented 4 years ago

Notifications in an initial test were flaky, and this may have to do with setInterval throttling when the tab isn't active. Investigate any other possibilities, and investigate moving the update mechanism into a web worker to avoid getting throttled.

alykat commented 4 years ago

Bug report from a station on the embedded version:

One other thing I just noticed though: The “Notify me about new posts” function doesn’t seem to work cross-browser. Safari gives me an option to allow notifications when I click that checkbox (which appeared checked when I started, btw – I don’t know if that’s it’s intended behavior or not but it made me think it was enabled by default). But FireFox throws an error: “The Notification permission may only be requested in a top-level document or same-origin iframe”. And Chrome doesn’t respond at all, not even with a console error, but I assume it’s also a security error. Silly Safari.

thomaswilburn commented 4 years ago

Ah, okay. We'll have to hide that for embeds, then.

thomaswilburn commented 4 years ago

Honestly, at this point I'm thinking we should lose the notifications by default, and consider them for further development at a later date. They're a neat idea, and I'm pretty sure we could make them work, but I don't really relish having a conversation with editors/reporters about "yes, it works on non-NPR machines, trust me," and station support seems like it could be a minefield.

alykat commented 4 years ago

Makes sense to me.