I've integrated a third-party chatbot with the help of script tag in the public/index.html. But on some urls I don't want to show the chatbot at all.
How can I remove the script tag depending on the url before/after it loads.
public/index.html:
<body>
<div id="root"></div>
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/<TOKEN_ID>/default';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
</body>