| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 if (window == top) { |
| 6 findFeeds(); |
| 7 window.addEventListener("focus", findFeeds); |
| 8 } |
| 9 |
| 10 function findFeeds() { |
| 11 // Find all the RSS link elements. |
| 12 var result = document.evaluate( |
| 13 '//link[@rel="alternate"][contains(@type, "rss") or ' + |
| 14 'contains(@type, "atom") or contains(@type, "rdf")]', |
| 15 document, null, 0, null); |
| 16 |
| 17 var feeds = []; |
| 18 var item; |
| 19 while (item = result.iterateNext()) |
| 20 feeds.push(item.href); |
| 21 |
| 22 // Notify the extension of the feed URLs we found. |
| 23 chrome.extension.connect().postMessage(feeds); |
| 24 } |
| OLD | NEW |