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

Side by Side Diff: chrome/test/data/extensions/samples/subscribe_page_action/feed_finder.js

Issue 115536: Add the RSS page action extension.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698