Skip to content

Commit

Permalink
1.0.3: update YouTube functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aminomancer committed Nov 12, 2022
1 parent 5b76c53 commit 4143ad9
Show file tree
Hide file tree
Showing 29 changed files with 6,037 additions and 5,554 deletions.
44 changes: 22 additions & 22 deletions Background.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
var instData = { open: false, tab: null };
chrome.browserAction.setTitle({ title: "No media loaded" });

chrome.runtime.onMessage.addListener((request, sender) => {
if (instData.tab !== null && instData.tab !== sender.tab.id) return;
switch (request.method) {
case "open":
if (instData.tab === null) {
chrome.browserAction.setTitle({ title: "Connected to media" });
instData.tab = sender.tab.id;
}
break;
case "closed":
if (instData.tab !== null) {
chrome.browserAction.setTitle({ title: "No media loaded" });
instData.tab = null;
}
break;
default:
break;
}
});
var instData = { open: false, tab: null };
chrome.browserAction.setTitle({ title: "No media loaded" });

chrome.runtime.onMessage.addListener((request, sender) => {
if (instData.tab !== null && instData.tab !== sender.tab.id) return;
switch (request.method) {
case "open":
if (instData.tab === null) {
chrome.browserAction.setTitle({ title: "Connected to media" });
instData.tab = sender.tab.id;
}
break;
case "closed":
if (instData.tab !== null) {
chrome.browserAction.setTitle({ title: "No media loaded" });
instData.tab = null;
}
break;
default:
break;
}
});
Loading

0 comments on commit 4143ad9

Please sign in to comment.