comparison content_scripts/feed-probe.js @ 31:76e23b361e92

Allow feed reader addons to subscribe to the currently viewed feed Add a link element to the feed preview that points to the currently viewed feed in order to allow feed reader addons to subscribe to it.
author Guido Berhoerster <guido+feed-preview@berhoerster.name>
date Tue, 22 Jan 2019 14:40:06 +0100
parents da483ce3832d
children ede87e1004f9
comparison
equal deleted inserted replaced
30:b9dc94ce2eeb 31:76e23b361e92
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 === document.URL) {
21 // do not indicate the availability of a feed if the current
22 // document is already a feed preview
23 continue;
24 }
25
20 if (!element.href.match(/^https?:\/\//)) { 26 if (!element.href.match(/^https?:\/\//)) {
21 continue; 27 continue;
22 } 28 }
23 29
24 urlsFeeds.set(element.href, { 30 urlsFeeds.set(element.href, {