fix: whole page rss check

This commit is contained in:
DIYgod
2023-12-16 22:35:05 +08:00
parent a65da8c468
commit 8106effe7a
+12 -13
View File
@@ -141,20 +141,19 @@ export async function getPageRSS(data: {
}
if (html) {
rssParser.parseString(html, (err, result) => {
if (!err) {
chrome.runtime.sendMessage(null, {
text: "addPageRSS",
feed: {
url: location.href,
title: result.title,
image
}
})
}
})
let feed
try {
feed = await rssParser.parseString(html)
} catch (error) {}
if (feed) {
pageRSS.push({
url: location.href,
title: feed.title,
image
});
unique.save(location.href)
}
}
}
unique.save(location.href)
return pageRSS
}