Google chrome extension 如何为我的网站更改创建Chrome通知?

Google chrome extension 如何为我的网站更改创建Chrome通知?,google-chrome-extension,web,notifications,Google Chrome Extension,Web,Notifications,如何创建google chrome扩展,并为我的网站页面中的每一个更改发送通知?如果您的网站有RSS提要,您可以执行类似操作(仅新页面): 使用jQuery获取并解析RSS提要: $.get('http://yoursite.com/rss', function(data) { $(data).find('item').each(function() { var url_news = $(this).find('link').text(); var news_id

如何创建google chrome扩展,并为我的网站页面中的每一个更改发送通知?

如果您的网站有RSS提要,您可以执行类似操作(仅新页面):

使用jQuery获取并解析RSS提要:

$.get('http://yoursite.com/rss', function(data) {
   $(data).find('item').each(function() {
      var url_news = $(this).find('link').text();
      var news_id = $(this).find('id').text();
      var descr = $(this).find('title').text();
   });
});
使用Chrome通知显示通知


更新rss源时,chrome extension将显示通知

你甚至会使用Google bro吗?试试这些。。。。
var title = "Title";
var notification = webkitNotifications.createNotification(img, title, descr);
   notification.onclick = function() {
      chrome.tabs.create({url: url_news}, notification.cancel());
      chrome.windows.getLastFocused(null, function(win){
         if(win.state=="minimized"){
            chrome.windows.update(win.id, {state:"normal", focused:true});
         }
      });
   };
   notification.show();