Skip to content

Instantly share code, notes, and snippets.

@arafathusayn
Last active February 21, 2021 08:47
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save arafathusayn/ba49ff4f8d49a427aaf73acb78061978 to your computer and use it in GitHub Desktop.
Save arafathusayn/ba49ff4f8d49a427aaf73acb78061978 to your computer and use it in GitHub Desktop.
Hide Tidio Chat Branding (Old Theme). For new theme, check: https://gist.github.com/arafathusayn/663217f383b02017d20be6ba465959d4
function hideTdo() {
var timer = null;
var target = document.querySelector('#tidio-chat iframe');
if(!target) {
if(timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(hideTdo, 500);
return;
} else {
var timer2 = null;
var tdo = document.querySelector('#tidio-chat iframe')
.contentDocument
.querySelector('a[href*="tidio.com/powered"]');
if(!tdo) {
if(timer2 !== null) {
clearTimeout(timer2);
}
timer2 = setTimeout(hideTdo, 1);
return;
}
document.querySelector('#tidio-chat iframe')
.contentDocument
.querySelector('a[href*="tidio.com/powered"]')
.remove();
return true;
}
}
hideTdo();
setInterval(hideTdo, 10);
@yieoyo
Copy link

yieoyo commented Jul 16, 2020

use below:
document.querySelector('#tidio-chat iframe').contentDocument.querySelector('form').nextSibling.remove();

instead of below:
document.querySelector('#tidio-chat iframe').contentDocument.querySelector('a[target=_blank]').remove();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment