From 5665420266761e4e838bf81def9672988341390a Mon Sep 17 00:00:00 2001 From: mirhossein Date: Tue, 11 Jun 2024 11:03:16 +0000 Subject: [PATCH] wip --- main.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 7bf6a3a..d5c4ea9 100644 --- a/main.js +++ b/main.js @@ -225,7 +225,7 @@ function createSurflySession(contactId, inviteType) { function sendFollowerLink(followerLink, type, uniquePageId, channelId) { fetch( - "https://nic.surf.ly/follower_link", + "https://admin-api-backend-ef6aeff35287.herokuapp.com/follower_link", { method: "POST", headers: { @@ -376,3 +376,20 @@ function initializeChatNiC() { console.log('Initializing NiC'); } + +var observer = new MutationObserver(function (mutations) { + mutations.forEach(function (mutation) { + mutation.addedNodes.forEach(function (node) { + // Check a second condition to make sure it's the chat widget + if ( + node.id === "be-chat-container" && + window.document.querySelector("#be-chat-container iframe[id^='BrandEmbassy-iframe']") + ) { + node.remove(); + observer.disconnect(); + } + }); + }); +}); +var chat_messenger_frame = document.getElementById("icChat"); +observer.observe(chat_messenger_frame.contentDocument.body, { childList: true, subtree: true, characterData: true, attributes: true});