fix(browser-extension): issue #308

This commit is contained in:
wanhose 2023-10-08 12:06:10 +02:00
parent 9c3f73a1ad
commit a3715a4615

View File

@ -144,7 +144,7 @@ function fix() {
const backdrop = document.getElementsByClassName('modal-backdrop')[0];
const facebook = document.getElementsByClassName('_31e')[0];
const fixes = data?.fixes ?? [];
const skips = data?.skips ?? [];
const skips = (data?.skips ?? []).map((x) => (x.split('.').length < 3 ? `*${x}` : x));
if (backdrop?.children.length === 0) {
backdrop.remove();
@ -177,7 +177,7 @@ function fix() {
}
}
if (skips.indexOf(hostname) === -1) {
if (skips.some((x) => hostname.match(x.replace(/\*/g, '[^ ]*')))) {
for (const element of [document.body, document.documentElement]) {
element?.classList.remove(...(data?.classes ?? []));
element?.style.setProperty('position', 'initial', 'important');