blob: d5c4f2afa89d903ac89f7aedcc7bfa0db716476a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
if (window == top) {
findFeeds();
window.addEventListener("focus", findFeeds);
}
function findFeeds() {
// 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);
// Notify the extension of the feed URLs we found.
chrome.extension.connect().postMessage(feeds);
}
|