From c71aad6ef31cce44b0d755a030d6621674138171 Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Thu, 15 Feb 2024 10:26:48 +0100 Subject: [PATCH] [FIX] im_livechat: odoo error popup on external pages Before this commit, an Odoo dialog would open to show errors that occurred in the pages embedding the live chat. We should not display errors originating from outside the embedded script. Moreover, the error service listens to the error event on the window object. Thus, errors occurring in the shadow DOM won't be caught. As a result, the error service disrupts the site that embeds it and is entirely useless for the live chat. This PR removes the error service from the embedded live chat. OPW-3699040 closes odoo/odoo#154102 X-original-commit: 24b6b7a43748b5f1053aa7c70dc7046dbc894c7f Signed-off-by: Matthieu Stockbauer (tsm) --- addons/im_livechat/static/src/embed/cors/boot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/im_livechat/static/src/embed/cors/boot.js b/addons/im_livechat/static/src/embed/cors/boot.js index 05478c7d7f9..316291196d0 100644 --- a/addons/im_livechat/static/src/embed/cors/boot.js +++ b/addons/im_livechat/static/src/embed/cors/boot.js @@ -42,4 +42,8 @@ import { session } from "@web/session"; }, { force: true } ); + // Remove the error service: it fails to identify issues within the shadow + // DOM of the live chat and causes disruption for pages that embed it by + // displaying pop-ups for errors outside of its scope. + registry.category("services").remove("error"); })();