feat(scripts): update content script
This commit is contained in:
parent
8c391ef8f4
commit
7406b21c1b
@ -22,19 +22,15 @@ if (!!window.chrome) {
|
|||||||
const text = await fetch(filtersUrl).then((res) => res.text());
|
const text = await fetch(filtersUrl).then((res) => res.text());
|
||||||
const filters = text.split("\n");
|
const filters = text.split("\n");
|
||||||
|
|
||||||
filters.forEach((item) => {
|
filters.forEach((match) => {
|
||||||
const [url, match] = item.split("##");
|
const element = document.querySelector(match);
|
||||||
|
|
||||||
if (url === "" || currentUrl.includes(url)) {
|
if (
|
||||||
const element = document.querySelector(match);
|
element &&
|
||||||
|
element.tagName !== "BODY" &&
|
||||||
if (
|
element.tagName !== "HTML"
|
||||||
element &&
|
) {
|
||||||
element.tagName !== "BODY" &&
|
element.remove();
|
||||||
element.tagName !== "HTML"
|
|
||||||
) {
|
|
||||||
element.remove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user