-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
18 lines (14 loc) · 586 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// When the button is clicked, inject removeCommunityWrapper into current page
communityWrapper.addEventListener("click", async () => {
let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
chrome.scripting.executeScript({
target: { tabId: tab.id },
function: removeCommunityWrapper,
});
});
function removeCommunityWrapper() {
let wrapperClass = "MaterialView-community";
let div = document.getElementsByClassName(wrapperClass);
div[0].parentNode.removeChild(div[0]);
console.log("MaterialView-community-wrapper succesfully removed");
}