Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4951)

Unified Diff: chrome/test/data/extensions/samples/subscribe/feed_finder.js

Issue 99172: Part 1 of sample sprucing. (Closed)
Patch Set: Added buildbot.crx, since that seems like something people might want to install. Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698