Rehide other elements too

This commit is contained in:
Arne Keller 2019-07-13 12:11:25 +02:00
parent 6b54383dec
commit fc6341cb48

View File

@ -56,7 +56,7 @@ window.ytacListener = (message) => {
console.log("[YTAC] received browser action " + message.command); console.log("[YTAC] received browser action " + message.command);
if (message.command == "comments") { if (message.command == "comments") {
console.log("[YTAC] showing comments"); console.log("[YTAC] showing comments");
document.getElementById("ytaccomments").remove(); document.getElementById("ytaccomments").remove();
} else if (message.command == "sidebar") { } else if (message.command == "sidebar") {
console.log("[YTAC] showing video sidebar"); console.log("[YTAC] showing video sidebar");
document.getElementById("ytacsidebar").remove(); document.getElementById("ytacsidebar").remove();
@ -64,12 +64,15 @@ window.ytacListener = (message) => {
} else if (message.command == "invideo") { } else if (message.command == "invideo") {
console.log("[YTAC] showing in-video suggestions"); console.log("[YTAC] showing in-video suggestions");
document.getElementById("ytacinvideo").remove(); document.getElementById("ytacinvideo").remove();
addClickListeners("invideo");
} else if (message.command == "endscreen") { } else if (message.command == "endscreen") {
console.log("[YTAC] showing endscreen"); console.log("[YTAC] showing endscreen");
document.getElementById("ytacendscreen").remove(); document.getElementById("ytacendscreen").remove();
addClickListeners("endscreen");
} else if (message.command == "notification") { } else if (message.command == "notification") {
console.log("[YTAC] showing notification bell"); console.log("[YTAC] showing notification bell");
document.getElementById("ytacnotification").remove(); document.getElementById("ytacnotification").remove();
addClickListeners("notification");
} }
}; };
browser.runtime.onMessage.addListener(window.ytacListener); browser.runtime.onMessage.addListener(window.ytacListener);