1
0
mirror of https://github.com/aureliendavid/rsspreview.git synced 2025-08-24 20:28:37 +00:00
rsspreview/popup/popup.js
Aurelien David aa70671c62 add basic feed detection (#11):
* disabled by default for now
* works on link rel=alternate declarations
2019-01-19 17:44:24 +01:00

25 lines
527 B
JavaScript

document.addEventListener("DOMContentLoaded", function(event) {
const feedList = document.getElementById('feedList');
const url = new URL(location.href);
const feeds = JSON.parse(url.searchParams.get('feeds'));
for (feed_url in feeds) {
if (feeds.hasOwnProperty(feed_url)) {
let li = document.createElement("li");
let a = document.createElement("a");
a.href = feed_url;
a.target = "_blank";
a.innerText = feeds[feed_url];
li.appendChild(a);
feedList.appendChild(li);
}
}
});