This doesn’t work: https://support.freshchat.com/support/solutions/articles/238297-how-do-i-hide-the-freshchat-widget-on-certain-pages-of-my-website-
I get the following console error: Uncaught TypeError: Cannot read property 'init' of undefined
This doesn’t work: https://support.freshchat.com/support/solutions/articles/238297-how-do-i-hide-the-freshchat-widget-on-certain-pages-of-my-website-
I get the following console error: Uncaught TypeError: Cannot read property 'init' of undefined
Best answer by julianpapaya
To hide the Freshchat widget on specific pages, use this JavaScript code:
window.fcWidget.init();
if (window.location.pathname === '/page-to-hide') {
window.fcWidget.hide();
}
Explanation:
Replace '/page-to-hide' with the URL path of the page where you want to hide the widget.
To hide it on multiple pages, use this version:
const hidePages = ['/page1', '/page2', '/page3'];
if (hidePages.includes(window.location.pathname)) {
window.fcWidget.hide();
}
This will hide the widget only on the pages you specify.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.