Index: chrome/test/data/extensions/samples/subscribe/feed_finder.js |
diff --git a/chrome/test/data/extensions/samples/subscribe/feed_finder.js b/chrome/test/data/extensions/samples/subscribe/feed_finder.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..91593b5628bd06ed4db48ea2faa73042ef128425 |
--- /dev/null |
+++ b/chrome/test/data/extensions/samples/subscribe/feed_finder.js |
@@ -0,0 +1,19 @@ |
+find(); |
+window.addEventListener("focus", find); |
+ |
+function find() { |
+ if (window == top) { |
+ // Find all the RSS link elements. |
+ var result = document.evaluate( |
+ '//link[@rel="alternate"][contains(@type, "rss") or ' + |
+ 'contains(@type, "atom") or contains(@type, "rdf")]', |
+ document, null, 0, null); |
+ |
+ var feeds = []; |
+ var item; |
+ while (item = result.iterateNext()) |
+ feeds.push(item.href); |
+ |
+ chromium.extension.connect().postMessage(feeds); |
+ } |
+} |