diff 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
line wrap: on
line diff
--- a/content_scripts/feed-probe.js	Tue Jan 22 10:43:24 2019 +0100
+++ b/content_scripts/feed-probe.js	Tue Jan 22 14:40:06 2019 +0100
@@ -17,6 +17,12 @@
             '[type="application/rss+xml"])');
 
     for (let element of elements) {
+        if (element.href === document.URL) {
+            // do not indicate the availability of a feed if the current
+            // document is already a feed preview
+            continue;
+        }
+
         if (!element.href.match(/^https?:\/\//)) {
             continue;
         }