feat(content): code improvements
This commit is contained in:
parent
ffdb020708
commit
93284105a5
@ -18,8 +18,12 @@ if (typeof chrome.app.isInstalled !== 'undefined') {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const removableElements = Array.from([
|
const removableElements = Array.from([
|
||||||
|
// ENS
|
||||||
|
document.getElementById("ensNotifyBanner"),
|
||||||
// Quantcast
|
// Quantcast
|
||||||
...document.getElementsByClassName("qc-cmp-ui-container"),
|
...document.getElementsByClassName("qc-cmp-ui-container"),
|
||||||
|
// OneTrust
|
||||||
|
document.getElementById("onetrust-consent-sdk"),
|
||||||
// Optanon
|
// Optanon
|
||||||
...document.getElementsByClassName("optanon-alert-box-wrapper"),
|
...document.getElementsByClassName("optanon-alert-box-wrapper"),
|
||||||
]);
|
]);
|
||||||
@ -29,19 +33,7 @@ if (typeof chrome.app.isInstalled !== 'undefined') {
|
|||||||
element.classList.remove("qc-cmp-ui-showing");
|
element.classList.remove("qc-cmp-ui-showing");
|
||||||
});
|
});
|
||||||
|
|
||||||
removableElements.forEach(element => {
|
removableElements.forEach(element => !!element && element.remove());
|
||||||
element.remove();
|
|
||||||
});
|
|
||||||
|
|
||||||
let removableElement = null;
|
|
||||||
|
|
||||||
// ENS
|
|
||||||
removableElement = document.getElementById("ensNotifyBanner");
|
|
||||||
if (!!removableElement) removableElement.remove();
|
|
||||||
|
|
||||||
// OneTrust
|
|
||||||
removableElement = document.getElementById("onetrust-consent-sdk");
|
|
||||||
if (!!removableElement) removableElement.remove();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Observer starts observe when call this function
|
// Observer starts observe when call this function
|
||||||
|
Loading…
Reference in New Issue
Block a user