Merge pull request #429 from da2x/patch-2
Use query selector to better detect feed links
This commit is contained in:
commit
db238e8aee
|
@ -42,21 +42,17 @@ function scanForSyndicationFeeds() {
|
|||
// variables to empty instead of null.
|
||||
thisPageLinkObjects = []
|
||||
|
||||
thisPageLinks = document.getElementsByTagName("link");
|
||||
thisPageLinks = document.querySelectorAll("link[href][rel~='alternate'][type]");
|
||||
|
||||
for (thisLinkIndex = 0; thisLinkIndex < thisPageLinks.length; thisLinkIndex++)
|
||||
{
|
||||
var thisLink = thisPageLinks[thisLinkIndex];
|
||||
var thisLinkRel = thisLink.getAttribute("rel");
|
||||
if (thisLinkRel == "alternate")
|
||||
{
|
||||
if (isValidFeedLink(thisLink))
|
||||
{
|
||||
thisPageLinkObjects.push(objectFromLink(thisLink));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function subscribeToFeed(theFeed) {
|
||||
// Convert the URL to a feed:// scheme because Safari
|
||||
|
|
Loading…
Reference in New Issue