A Greasemonkey script to detect RSS feed URLs

A floater automatically displaying RSS feed(s) of any web page or site

The saboteurs (probably from Google) who ru(i)n Mozilla have removed RSS support from Firefox. Seamonkey seems to still support it, both in the browser and the email client.

I use this script in one of my Firefox profiles to detect RSS feeds. (I use add-ons (or extensions) only in one of my many browser profiles that I use for casual browsing. The other profiles do not have any add-ons for security reasons.)

// ==UserScript==
// @name         DetectRSS.UserJS
// @namespace    com.vsubhash.js.detect_rss.user.js
// @description  Displays an overlay containing detected RSS feeds.
// @include      https://*
// @include      http://*
// @version      1
// @grant        none
// ==/UserScript==

document.addEventListener("readystatechange", onLoader, false); 
iRndm=Math.round(3000 + Math.random()*2000);
bFound=false;

function onLoader() {
    try {
        if (document.readyState == "complete"){
          window.setTimeout(detectRSS, 2*1000);
        } else {
            console.error("DetectRSS.UserJS: Not loaded");
        }
    } catch(e) {
        console.error("DetectRSS.UserJS: " + e);
    }
}

function detectRSS() {
  if (bFound) { return; }
    var oLinks = document.querySelectorAll("link[type*='rss']");
    if (oLinks.length > 0) {
        var oFloater = document.createElement("div");
        var sHTML = "RSS:<ol style=\"font-size: 9px;  \">";
        oFloater.style = "text-align: left; padding: 1em; background-color: rgba(0,0,0,0.1); color: orangered; position: fixed; z-index: 9999; font: bold 9px sans-serif; top: 100px; right: 20px; max-width: 20%;  max-height: 100px; overflow: auto;";
        document.getElementsByTagName("body")[0].insertBefore(oFloater, document.getElementsByTagName("body")[0].firstElementChild);
        for (var i = 0; i < oLinks.length; i++) {
          if (oLinks[i].hasAttribute("title") && oLinks[i].hasAttribute("href")) {
            sHTML += "<li><a href=\"" + oLinks[i].getAttribute("href") + "\">" + oLinks[i].getAttribute("title") + "</a></li>";
            console.log("DetectRSS.UserJS: Added RSS #" + (i+1) + ": " + oLinks[i].getAttribute("title"));
          } else {
            console.log("DetectRSS.UserJS: Invalid RSS" + (i+1));
          }
        }
        sHTML += "</ol>";
        oFloater.innerHTML = sHTML;
        bFound=true;
    } else {
        console.log("DetectRSS.UserJS: No RSS found in " + document.URL);
    }
}

Screenshot


UPDATE (17 December 2023): Browser scripts can also be used in the Palemoon browser.

Link: | Magic Link:

Comments are not enabled yet.

For older posts, check the archives.