1
0
mirror of https://github.com/aureliendavid/rsspreview.git synced 2025-08-22 19:28:39 +00:00

fix for link elements with no type (#16)

This commit is contained in:
Aurelien David 2019-01-21 14:10:35 +01:00
parent aa70671c62
commit 7b63b27f4a
2 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "RSSPreview",
"version": "3.0",
"version": "3.0.1",
"author": "Aurelien David",
"homepage_url": "https://github.com/aureliendavid/rsspreview",

View File

@ -336,7 +336,12 @@
document.querySelectorAll("link[rel='alternate']").forEach( (elem) => {
let type = elem.getAttribute('type').toLowerCase();
let type_attr = elem.getAttribute('type');
if (!type_attr) {
return;
}
let type = type_attr.toLowerCase();
if (type.includes('rss') || type.includes('atom') || type.includes('feed')) {
let title = elem.getAttribute('title');
@ -346,10 +351,9 @@
feeds[url] = (title ? title : url);
//console.log("Feed: " + (title ? (title + " - ") : "") + url);
}
}
})
});
if (Object.keys(feeds).length > 0) {