Skip to content

Instantly share code, notes, and snippets.

@worksmarter
Forked from arafathusayn/hidetidio.js
Created March 18, 2020 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save worksmarter/f41fcf3411aa776d54cee0ae6ea771bd to your computer and use it in GitHub Desktop.
Save worksmarter/f41fcf3411aa776d54cee0ae6ea771bd to your computer and use it in GitHub Desktop.
Hide TidioChat Branding (for new theme)
function hideTdo() {
var timer = null;
var target = document.querySelectorAll('#tidio-chat iframe')[0];
if(!target || typeof target === 'undefined') {
if(timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(hideTdo, 500);
return;
} else {
var timer2 = null;
var tdo = document.querySelector('#tidio-chat iframe').contentDocument.querySelector(`a.powered`);
if(!tdo || typeof tdo === 'undefined') {
if(timer2 !== null) {
clearTimeout(timer2);
}
timer2 = setTimeout(hideTdo, 1);
return;
}
document.querySelector('#tidio-chat iframe').contentDocument.querySelector(`a.powered`).remove();
return true;
}
}
hideTdo();
setInterval(hideTdo, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment