Need to add data-ot-ignore to the preloader-image to stop the onetrust cookie-consent from blocking it, but api.onPageChange() seems to run once the preloader has gone
in my head_tag.html. I have script running api.onPageChange() and inside that…
function addIgnoreToPreloader () {
console.log("addIgnoreToPreloader running")
const splashWrapper = document.querySelector("#d-splash");
if(splashWrapper){
console.log("splashWrapper", splashWrapper)
}
const splashImage = splashWrapper && splashWrapper.querySelector(".preloader-image");
if(splashImage){
console.log("splashImage", splashImage);
splashImage.createAttribute("data-ot-ignore");
}
}
But is seems that by the time I see the console log “addIgnoreToPreloader running”. the page has already loaded and and the preloader has disappeared anyway…
Is there a hook/function to get to .preloader-image.