comparison content_scripts/feed-probe.js @ 25:da483ce3832d

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.
author Guido Berhoerster <guido+feed-preview@berhoerster.name>
date Fri, 28 Dec 2018 12:27:16 +0100
parents bc5cc170163c
children 76e23b361e92
comparison
equal deleted inserted replaced
24:ff0393719d57 25:da483ce3832d
11 const TIMEOUT_MAX = 800; // ms 11 const TIMEOUT_MAX = 800; // ms
12 12
13 function getFeeds() { 13 function getFeeds() {
14 let urlsFeeds = new Map(); 14 let urlsFeeds = new Map();
15 let elements = document.querySelectorAll(':-moz-any(link, a)[href]' + 15 let elements = document.querySelectorAll(':-moz-any(link, a)[href]' +
16 '[rel=alternate]:-moz-any([type="application/atom+xml"], ' + 16 '[rel~=alternate]:-moz-any([type="application/atom+xml"], ' +
17 '[type="application/rss+xml"])'); 17 '[type="application/rss+xml"])');
18 18
19 for (let element of elements) { 19 for (let element of elements) {
20 if (!element.href.match(/^https?:\/\//)) { 20 if (!element.href.match(/^https?:\/\//)) {
21 continue; 21 continue;