fix: missing url change in spa

This commit is contained in:
DIYgod
2019-07-23 11:08:53 +08:00
parent 3c26823202
commit 37643fa33d
+11 -1
View File
@@ -8,8 +8,18 @@ chrome.tabs.onActivated.addListener(function (tab) {
});
});
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
if (changeInfo.url && tab.active) {
chrome.tabs.sendMessage(tab.id, {
text: 'getPageRSS',
}, (feeds) => {
handleRSS(feeds, tab.id);
});
}
});
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
if (msg.text === 'setPageRSS' && sender.tab.active) {
handleRSS(msg.feeds, sender.tab.id);
}
});
});