1

I am trying to send instant notifications when there is an update to my site.

I have create the extension and set up notifications

chrome.notifications.create(
  "%name",
  {
    type: "basic",
    iconUrl: "image.jpeg",
    title: %title,
    message: %message
  },
  function () {}
);

on my server I can create a file which checks for updates and displays them as an array for example

array = {
  "updates": [
    { "id:1", "title":"title1", "message":"message1" },
    { "id:2", "title":"title2", "message":"message2" }
  ]
 } 

Now how do I get the chrome extension to check the file for updates and set the updates as notifications.

I was thinking to do a jquery time out to checks the file periodically every xseconds. And loops through the array to create notifications. Would there be a problem with this? If there are duplicate IDs/notifications does chrome filter them or would I have to implement that?

0 Answers0