diff --git a/addons/web/static/src/core/browser/feature_detection.js b/addons/web/static/src/core/browser/feature_detection.js index 2aec3e0b60f..85740a1d88b 100644 --- a/addons/web/static/src/core/browser/feature_detection.js +++ b/addons/web/static/src/core/browser/feature_detection.js @@ -17,6 +17,15 @@ export function isBrowserFirefox() { return /Firefox/i.test(browser.navigator.userAgent); } +/** + * true if the browser is based on Safari (Safari, Epiphany) + * + * @returns {boolean} + */ +export function isBrowserSafari() { + return !isBrowserChrome() && browser.navigator.userAgent.includes("Safari"); +} + export function isAndroid() { return /Android/i.test(browser.navigator.userAgent); } diff --git a/addons/web/static/src/core/errors/error_service.js b/addons/web/static/src/core/errors/error_service.js index 12099acf7be..71aca19045d 100644 --- a/addons/web/static/src/core/errors/error_service.js +++ b/addons/web/static/src/core/errors/error_service.js @@ -4,8 +4,7 @@ import { browser } from "../browser/browser"; import { _t } from "@web/core/l10n/translation"; import { registry } from "../registry"; import { completeUncaughtError, getErrorTechnicalName } from "./error_utils"; -import { isIOS } from "@web/core/browser/feature_detection"; -import { session } from "@web/session"; +import { isIOS, isBrowserSafari } from "@web/core/browser/feature_detection"; /** * Uncaught Errors have 4 properties: @@ -86,7 +85,7 @@ export const errorService = { } let uncaughtError; if (!filename && !lineno && !colno) { - if (isIOS() && session.is_frontend && odoo.debug !== "assets") { + if ((isIOS() || isBrowserSafari()) && odoo.debug !== "assets") { // In Safari 16.4+ (as of Jun 14th 2023), an error occurs // when going back and forward through the browser when the // cache is enabled. A feedback has been reported but in the