This is not a programming problem, it is a BUG in the script https://imgs.ebit.com.br/ebitBR/selo-ebit/js/getSelo.js that keeps trying to call GIF when error occurs when downloading it, the script thinks it was a download error and or connection failure and keeps trying to download GIF, the problem is in 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 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
}
So look, when the Adblock blocks this image, then onerror
is shoots, in the onerror
again is tried to set the .src
of new Image
, but since Adblock is obviously still blocking this then it will re-enter onerror
, and this will stay until you disable Adblock, which means at this point you will be trying to loop/loop the image until you can. It’s not something we can solve, it’s a flaw in getSelo.js
.
To conclude there is nothing we can do, only the ebit site administrator can solve.
Just for the record FuckBlock
and BlockAdBlock
are the same script, do not change anything, only the name, the author created Blockadblock only to avoid that who would use the script did not go through some embarrassment with client or people, but the script in fact is the same:
Still you can try using /a/87992/3635 before loading the .js
, so 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>
This is not a programming problem, it is a bug in the script that keeps trying to call GIF because it was a failure in connection, there is nothing we can do, only ebit Adm can solve... You can still try https://answall.com/a/87992/3635 before loading the
.js
– Guilherme Nascimento
Got it, I’ll try to use it! Brigade :D
– Andrea
High chance of having a problem with refer(r)er. ebit probably only provides the correct banner for the correct domain (or no domain in the case of direct testing). Have to test in the original domain for which the ID has been set.
– Bacco
Andrea I posted a reply with an example of how to use with ebit.
– Guilherme Nascimento
Error 404 disappears if you insert the stamp instead of the banner:
<a id="seloEbit"></a>
... when insert banner gives error 404, it must be a same script bug or some kind of count that they do in background.– Sam
For the record, fuckAdblock (https://github.com/sitexw/FuckAdBlock) is the same as blockAdblock (https://github.com/sitexw/BlockAdBlock), created by the same author, i.e., the script I posted in my reply does not change anything in relation to the second answer and the loop problem was rather a "bug" because of this line in getSelo.js:
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}
– Guilherme Nascimento
Ready, edited reply with added details: https://answall.com/a/289499/3635
– Guilherme Nascimento