diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | index.js | 14 |
3 files changed, 18 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd7ce5c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.web-extension-id +web-ext-artifacts/ @@ -1,3 +1,7 @@ This extension has a popup that will give you the option to select from feeds on a page natively (from the link tag in the head), or with RSS-bridge configured to your liking. -This code is inspired and cloned somewhat from https://github.com/idealclover/Easy-to-RSS/ +This code is inspired and cloned somewhat from https://github.com/idealclover/Easy-to-RSS/. Icons are sourced from this repository as well. + +# TODO +- Add youtube rss + @@ -4,24 +4,32 @@ function subscribe_link(feed_url){ } window.onload = function () { + let feeds = document.getElementById('feeds'); + feeds.innerText = "Loading..." + console.log(feeds.innerHTML.toString()) browser.tabs.query({ active: true, currentWindow: true }, function (tabs) { browser.tabs.sendMessage(tabs[0].id, {}).then( function (feed_urls) { - let feeds = document.getElementById('feeds'); - // let feed_urls = get_feed_urls() - console.log("received ", feed_urls.length) + feeds.innerText = "" feed_urls.forEach(item => { let newLink = document.createElement('a'); newLink["href"] = item.url newLink.innerText = item.type; + let subLink = document.createElement('a'); subLink["href"] = subscribe_link(item.url) subLink.innerText = "subscribe"; + let newDiv = document.createElement('div'); newDiv.append(newLink) newDiv.append(subLink) feeds.append(newDiv) }) + if(feed_urls.length == 0) { + let newP = document.createElement('p') + newP.innerText = "No feeds found" + feeds.append(newP) + } }); }); } |