fix(browser-extension): content scripts not running fixes in preview pages
This commit is contained in:
parent
8817aa57b9
commit
81e5080da3
@ -66,10 +66,8 @@ function clean(elements, skipMatch) {
|
|||||||
function forceClean(element) {
|
function forceClean(element) {
|
||||||
const elements = [...element.querySelectorAll(data.elements)];
|
const elements = [...element.querySelectorAll(data.elements)];
|
||||||
|
|
||||||
if (elements.length) {
|
fix();
|
||||||
fix();
|
if (elements.length && !preview) clean(elements, true);
|
||||||
clean(elements, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -138,7 +136,7 @@ function match(element, skipMatch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Fixes scroll issues
|
* @description Fixes data, consent page and scroll issues
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -233,10 +231,8 @@ async function runSetup(skipReadyStateHack) {
|
|||||||
const observer = new MutationObserver((mutations) => {
|
const observer = new MutationObserver((mutations) => {
|
||||||
const elements = mutations.map((mutation) => Array.from(mutation.addedNodes)).flat();
|
const elements = mutations.map((mutation) => Array.from(mutation.addedNodes)).flat();
|
||||||
|
|
||||||
if (data?.elements.length && !preview) {
|
fix();
|
||||||
fix();
|
if (data?.elements.length && !preview) clean(elements);
|
||||||
clean(elements);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user