I’m working on a fork of an online Twitter client. (Streamie, if you’re interested.) I’d like to improve the Chrome notifications by using HTML notifications instead of the static ones it uses now.
The problem is that I need to get the tweet object from the main page to the notification, and I’m not sure how to do this. In my Chrome extension I got around this by making an array with a queue of tweets to show, adding a function to the window object which returned queue.shift() and then calling that function via chrome.extension.getBackgroundPage().dequeueMsg();.
However, I obviously don’t have this option in a web client. Is there any way to communicate from a notification with the window that opened it, or from the page to the notification’s DOM?
Well from the spec:
It looks like code in the notification page can access
window.openerjust like a page created withwindow.open()can. (Now, as to the practical aspect of doing this with today’s actual browsers, that’s another thing I guess.)