Removed tabUpdate as detecting in contentscript

This commit is contained in:
Official Noob
2019-08-08 19:25:29 +01:00
committed by GitHub
parent e1f1814748
commit 301e16b8f1

View File

@@ -1,24 +1,8 @@
//the id of this user, randomly generated once per install
var userID = null;
//when a new tab is highlighted
chrome.tabs.onActivated.addListener(
function(activeInfo) {
chrome.tabs.get(activeInfo.tabId, function(tab) {
tabUpdate(activeInfo.tabId);
})
}
);
//when a tab changes URLs
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo != undefined) {
//if URL changed
if (tabId) {
tabUpdate(tabId);
}
}
});
//the last video id loaded, to make sure it is a video id change
var sponsorVideoID = null;
chrome.runtime.onMessage.addListener(function (request, sender, callback) {
if (request.message == "submitTimes") {
@@ -164,13 +148,6 @@ function submitTimes(videoID, callback) {
});
}
function tabUpdate(tabId) {
//send a message to the content script
chrome.tabs.sendMessage(tabId, {
message: 'update'
});
}
function getUserID(callback) {
if (userID != null) {
callback(userID);