I'm developing an extension where I display some content on the sidebar based on specific youtube videos. I have these checks
// get message on tab change
browser.tabs.onActivated.addListener(function (activeInfo) {
browser.tabs.get(activeInfo.tabId, function (tab) {
GetInitialInfo(tab);
});
});
// get message on page load
browser.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
if (changeInfo.status == "complete") {
GetInitialInfo(tab);
}
});
// // on window load
window.onload = function () {
browser.tabs.query({ active: true, currentWindow: true }, function (tabs) {
GetInitialInfo(tabs[0]);
});
};
But none of them seem to detect when the youtube video changes. (The ajax bit).
I want GetInitialInfo()
to run on: tab change, page change, youtube video change.
I think it works on tab change and page change (I've tested this for so long I'm no longer sure) But because youtube video pages change ajax style (or however) I don't know how to detect that.