This is not a programming problem, it is a BUG in the script link is trying to call the GIF when there is an error in downloading it, the script thinks that it was an error in the download and / or a connection failure and tries to download the GIF, the problem is this line:
var a=new Image;a.src=null!=ebitBannerParameters?"https://www.ebitempresa.com.br/bitrate/banners/b1"+ebitNumEmp+"5"+t+".gif?"+ebitBannerParameters.value:"https://www.ebitempresa.com.br/bitrate/banners/b1"+ebitNumEmp+"5"+t+".gif",a.style.border="0px",a.onerror=function(){a.src=null!=ebitBannerParameters?"https://www.ebitempresa.com.br/bitrate/banners/banner"+t+".gif?storeId="+ebitNumEmp+"&"+ebitBannerParameters.value:"https://www.ebitempresa.com.br/bitrate/banners/banner"+t+".gif?storeId="+ebitNumEmp}
Adjusting the code for better visibility:
var a=new Image;
a.src=null!=ebitBannerParameters ? "https://www.ebitempresa.com.br/bitrate/banners/b1"+ebitNumEmp+"5"+t+".gif?"+ebitBannerParameters.value :
"https://www.ebitempresa.com.br/bitrate/banners/b1"+ebitNumEmp+"5"+t+".gif",
a.style.border="0px",
a.onerror=function(){
a.src=null!=ebitBannerParameters ? "https://www.ebitempresa.com.br/bitrate/banners/banner"+t+".gif?storeId="+ebitNumEmp+"&"+ebitBannerParameters.value :
"https://www.ebitempresa.com.br/bitrate/banners/banner"+t+".gif?storeId="+ebitNumEmp
}
Then, when adblock blocks that image, then onerror
is triggered, onerror
is again tried to set .src
of new Image
, but as obviously adblock is still is blocking this, it will re-enter onerror
, and this will remain until adblock is deactivated, or at this point it will keep trying to loop / cycle the image until it succeeds. It is not something we can solve, it is failed in getSelo.js
.
In conclusion there is nothing we can do, only the ebit site administrator can solve.
Just to include FuckBlock
and BlockAdBlock
are the same script, do not change anything, just the name, the author created the BlockAdBlock only to prevent anyone using the script was not under any constraint with client or people , but the actual script is the same:
Yet you can try using link before loading .js
, for example:
<script src="blockAdBlock.js"></script>
<script>
//Detect se o documento carregou
document.addEvent('DOMContentLoaded', function() {
//Se não detectar o adblock aplica o ebit
function adBlockNotDetected() {
var ebit = document.createElement("script");
ebit.src = "https://imgs.ebit.com.br/ebitBR/selo-ebit/js/getSelo.js?93414";
document.body.appendChild(ebit);
}
//Se detectar o adblock
function adBlockDetected() {
alert('AdBlock está ativado');
}
if(typeof blockAdBlock=== 'undefined') {
alert("blockAdBlock não foi carregado");
} else {
blockAdBlock.onDetected(adBlockDetected);
blockAdBlock.onNotDetected(adBlockNotDetected);
blockAdBlock.on(true, adBlockDetected);
blockAdBlock.on(false, adBlockNotDetected);
blockAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);
}
blockAdBlock.setOption('checkOnLoad', false);
blockAdBlock.setOption({
debug: true,
checkOnLoad: false,
resetOnEnd: false
});
});
</script>