iachat/app/javascript/dashboard
Muhsin Keloth a4c3d3d8c0
feat(widget): Allow widget loading in mobile app WebViews when domain restrictions are set (#13763)
When `allowed_domains` is configured on a web widget inbox, the server
responds with Content-Security-Policy: frame-ancestors <domains>, which
blocks the widget iframe in mobile app WebViews. This happens because
WebViews load content from file:// or null origins, which cannot match
any domain in the frame-ancestors directive.

This adds a per-inbox toggle — "Enable widget in mobile apps" — that
skips the frame-ancestors header when the request has no valid Origin
(i.e., it comes from a mobile WebView). Web browsers with a real origin
still get domain restrictions enforced as usual.

<img width="2330" height="1490" alt="CleanShot 2026-03-11 at 10 13
01@2x"
src="https://github.com/user-attachments/assets/d9326fac-020d-4ce7-9ced-0c185468c8fc"
/>


Fixes
https://linear.app/chatwoot/issue/CW-6560/widget-is-not-loading-from-iosandroid-widgets

How to test

1. Go to Settings → Inboxes → (Web Widget) → Configuration
2. Set allowed_domains to a specific domain (e.g., *.example.com)
3. Try loading the widget in a mobile app WebView — it should be blocked
4. Enable "Enable widget in mobile apps" checkbox
5. Reload the widget in the WebView — it should now load successfully
6. Verify the widget on a website not in the allowed domains list is
still blocked

---------

Co-authored-by: iamsivin <iamsivin@gmail.com>
2026-03-17 14:29:41 +04:00
..
api feat(whatsapp): add webhook registration and status endpoints (#13551) 2026-03-16 12:48:16 +05:30
assets chore: Remove vue-multiselect package and styles from codebase (#13585) 2026-02-19 15:42:34 +05:30
components fix: skip Enter key submission during IME composition in AI inputs (#13779) 2026-03-13 10:26:51 +05:30
components-next feat(widget): Allow widget loading in mobile app WebViews when domain restrictions are set (#13763) 2026-03-17 14:29:41 +04:00
composables fix: Add fix to only allow confirmed agents to used in Agent Assingments at Macros/Automations (#13225) 2026-03-11 02:01:53 -07:00
constants feat: Add a priority + created at sort for conversations (#13658) 2026-02-25 18:22:41 -08:00
helper feat: Add draft status for help center locales (#13768) 2026-03-17 12:45:54 +04:00
i18n feat(widget): Allow widget loading in mobile app WebViews when domain restrictions are set (#13763) 2026-03-17 14:29:41 +04:00
mixins feat: allow configuring attachment upload limit (#12835) 2025-11-17 14:03:08 -08:00
modules feat: compose form improvements (#13668) 2026-03-02 18:27:51 +05:30
routes feat(widget): Allow widget loading in mobile app WebViews when domain restrictions are set (#13763) 2026-03-17 14:29:41 +04:00
store fix: Prevent duplicate conversations in conversation list (#13713) 2026-03-06 14:07:02 +04:00
stores feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00
App.vue chore: Remove vue-multiselect package and styles from codebase (#13585) 2026-02-19 15:42:34 +05:30
featureFlags.js chore: make all the deprecated feature flag reclaimable (#13646) 2026-02-26 18:01:13 +05:30