# HG changeset patch # User Guido Berhoerster # Date 1545996436 -3600 # Node ID da483ce3832d822507a8943b42966bb178108052 # Parent ff0393719d576860f07f8d3e23da0870bde2b353 Fix selector for rel attributes The rel attribute may contain a list of words to describe link relationships, thus use the corect selector for that. diff -r ff0393719d57 -r da483ce3832d content_scripts/feed-probe.js --- a/content_scripts/feed-probe.js Sun Dec 16 10:29:19 2018 +0100 +++ b/content_scripts/feed-probe.js Fri Dec 28 12:27:16 2018 +0100 @@ -13,7 +13,7 @@ function getFeeds() { let urlsFeeds = new Map(); let elements = document.querySelectorAll(':-moz-any(link, a)[href]' + - '[rel=alternate]:-moz-any([type="application/atom+xml"], ' + + '[rel~=alternate]:-moz-any([type="application/atom+xml"], ' + '[type="application/rss+xml"])'); for (let element of elements) { diff -r ff0393719d57 -r da483ce3832d js/feed-parser.js --- a/js/feed-parser.js Sun Dec 16 10:29:19 2018 +0100 +++ b/js/feed-parser.js Fri Dec 28 12:27:16 2018 +0100 @@ -341,7 +341,7 @@ } let linkElement = feedQueryXPath(this.document, entryElement, - './atom03:link[@href][@rel="alternate"]'); + './atom03:link[@href][@rel~="alternate"]'); if (linkElement !== null) { link = parseURL(linkElement.getAttribute('href'), this.url); } @@ -515,7 +515,7 @@ } let linkElement = feedQueryXPath(this.document, entryElement, - './atom:link[@href][not(@rel) or @rel="alternate"]'); + './atom:link[@href][not(@rel) or @rel~="alternate"]'); if (linkElement !== null) { link = parseURL(linkElement.getAttribute('href'), this.url); } @@ -540,7 +540,7 @@ } for (let enclosureElement of feedQueryXPathAll(this.document, - entryElement, './atom:link[@href][@rel="enclosure"]')) { + entryElement, './atom:link[@href][@rel~="enclosure"]')) { try { let entryFile = this.parseAtomEntryFile(enclosureElement); files.push(entryFile);