Added camera access permission to the safe apps iframe #3310
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Pull Request Test Coverage Report for Build 1708658932
💛 - Coveralls |
Deployment links
|
E2E Tests Failed Failed tests:
|
@@ -165,7 +165,7 @@ | |||
] | |||
}, | |||
"dependencies": { | |||
"@gnosis.pm/safe-apps-sdk": "6.1.0", | |||
"@gnosis.pm/safe-apps-sdk": "6.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no related with this PR
@@ -320,6 +320,7 @@ const AppFrame = ({ appUrl }: Props): ReactElement => { | |||
src={appUrl} | |||
title={safeApp.name} | |||
onLoad={onIframeLoad} | |||
allow={'camera'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need not use braces, e.g. allow='camera'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! :D
done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📸
Hi guys it seems that the And also I found a minor bug in the
but it should be:
With the current type we only accept arrays with 1 item. I will create a PR in the CC: @katspaugh @iamacook |
Thanks Dani! |
What it solves
As a part of this ticket to add Camera support on WalletConnect Safe App we need to add special policy to the safe apps iframe.
More info:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attributes
https://developer.mozilla.org/en-US/docs/Web/HTTP/Feature_Policy/Using_Feature_Policy#allowlist
https://blog.addpipe.com/camera-and-microphone-access-in-cross-oirigin-iframes-with-feature-policy/
How this PR fixes it
added
allow={'camera'}
special policy to the safe apps iframe.The
allowlist
special policy is no needed because Walletconnect Safe App is deployed in the same origin that the Safe. For more details see it in the allowlist docsSafe origin: https://gnosis-safe.io/app/welcome
WalletConnect Safe App origin: https://apps.gnosis-safe.io/wallet-connect
Screenshots