From 4f04889b634e98dfba9cc96fe4b3ab72cf2209ce Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 5 Aug 2022 19:22:48 +0200 Subject: [PATCH] Web Bots: Allow requesting storage (#1966) --- src/components/main/WebAppModal.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/main/WebAppModal.tsx b/src/components/main/WebAppModal.tsx index c8407b19c..df025ab10 100644 --- a/src/components/main/WebAppModal.tsx +++ b/src/components/main/WebAppModal.tsx @@ -55,6 +55,14 @@ const MAIN_BUTTON_ANIMATION_TIME = 250; const PROLONG_INTERVAL = 45000; // 45s const ANIMATION_WAIT = 400; const LINK_PREFIX = 'https://t.me/'; +const SANDBOX_ATTRIBUTES = [ + 'allow-scripts', + 'allow-same-origin', + 'allow-popups', + 'allow-forms', + 'allow-modals', + 'allow-storage-access-by-user-activation', +].join(' '); const WebAppModal: FC = ({ webApp, @@ -369,7 +377,7 @@ const WebAppModal: FC = ({ className={buildClassName('web-app-frame', shouldDecreaseWebFrameSize && 'with-button')} src={url} title={`${bot?.firstName} Web App`} - sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-modals" + sandbox={SANDBOX_ATTRIBUTES} allow="camera; microphone; geolocation;" allowFullScreen />