New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow aragon apps to request camera and microphone access #378

Merged
merged 2 commits into from Dec 12, 2018

Conversation

Projects
None yet
4 participants
@asoltys
Copy link
Contributor

asoltys commented Oct 9, 2018

Our motivation for this at Althea is to allow our app to scan QR codes

This pull bumps the styled-components dependency to ensure that the attributes
are not swallowed by their property validation as implemented by the
following PRs:

styled-components/styled-components#2083
styled-components/styled-components#2085

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Oct 9, 2018

CLA assistant check
All committers have signed the CLA.

@sohkai

sohkai approved these changes Oct 10, 2018

Copy link
Member

sohkai left a comment

📷 🎤 🌟

@@ -182,6 +182,8 @@ class AppIFrame extends React.Component {
{progressBar}
<StyledIFrame
name="AppIFrame"
allow="camera; microphone"
allowusermedia

This comment has been minimized.

@sohkai

sohkai Oct 10, 2018

Member

Reading the spec on allowusermedia, it seems like we don't need it since allow="camera; microphone" supersedes it.

However, it looks like allow's not very compatible yet so I wonder if allowusermedia is more compatible at this point. I haven't been able to find compatibility tables for allowusermedia, though.

This comment has been minimized.

@asoltys

asoltys Oct 10, 2018

Contributor

That was my thinking but actually it looks like allowusermedia is pretty new too and Chromium at least implemented support for both attributes at the same time last year so it probably makes sense to just remove allowusermedia:

https://bugs.chromium.org/p/chromium/issues/detail?id=682258

That being said, I think this pull doesn't actually work! I had thought when I was testing it out that adding allow="camera" was letting me access the camera in our Aragon app but I think at some point I had removed the sandbox attribute in my linked aragon wrapper and didn't test properly with it turned back on.

Possibly relevant Firefox tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1389198

I'm still not sure why it's not working in Chromium. I'll try to investigate a bit more so maybe hold off on merging this for now.

This comment has been minimized.

@asoltys

asoltys Nov 23, 2018

Contributor

@sohkai I have a feeling that the allow attribute should work in Chromium if https is enabled but I haven't figured out how to run aragon locally over https to test it ou (I tried setting up a proxy with nginx but it didn't like that the websocket and ipfs connections weren't secure). Would you be able to confirm and then possibly merge this for us? I took off the allowusermedia attribute.

This comment has been minimized.

@sohkai

sohkai Dec 6, 2018

Member

@asoltys I think you might've been bit by the allowlist's origin.

Reading the spec, the default origin for the iframe attribute is "src", which represents the origin of the iframe's src attribute. However, we explicitly don't include allow-same-origin in the iframe's sandboxing, rendering the subframe's origin to be completely detached.

Could you try again with allow="camera *; microphone *"?


AFAIK this shouldn't be related to https, but maybe I missed something in the spec that only allows this in secure origins?

@asoltys asoltys force-pushed the asoltys:allow-app-iframe-to-access-media-devices branch from 7458624 to 059c73e Nov 23, 2018

@sebohe

This comment has been minimized.

Copy link

sebohe commented Dec 11, 2018

After some looking around it seems that the issue might be cors related.

The app is being served from: https://ipfs.eth.aragon.network/ipfs/QmZNYZLaom5A9BNU6CKgj7yeXhfP8Ej4PnDdobMUkWDMS

and the main website is on: https://rinkeby.aragon.org/#/althea.aragonid.eth/0xa48f0c486cc2fb830067b388f1497244ab7fa6b0

So code from the ipfs content can't access the the camera on the https://rinkeby.aragon.org url.

This is just an idea.

@sohkai

This comment has been minimized.

Copy link
Member

sohkai commented Dec 11, 2018

@sebohe I would hope that the cross origin issue would be solved with * as the allowlist (that's what it should be for...). Otherwise, we should have CORS enabled on our ipfs gateway as well.

@sohkai

This comment has been minimized.

Copy link
Member

sohkai commented Dec 12, 2018

@asoltys @sebohe I've added * as the allowlist, as I mentioned in #378 (comment).

@sohkai sohkai merged commit 664397d into aragon:master Dec 12, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment