Skip to content
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

Add sandbox attritube to iframe to allow downloads with new privacy s… #97

Closed
wants to merge 2 commits into from

Conversation

sarahrose-ferris
Copy link

@sarahrose-ferris sarahrose-ferris commented Oct 23, 2023

…andbox settings
https://linear.app/whereby/issue/KOA-448/add-allow-downloads-to-the-iframe-injected-by-the-browser-sdk

Due to the upcoming privacy sandbox changes from Chrome, some issues are appearing when attempting to download local recordings from an iframe.

Adding 'allow-downloads' is the first piece of the work toward allowing users to download local-recordings from in room experience rather than getting redirecting to the dashboard. I also removed the 'speaker' attribute that is no longer supported in chrome.

Note:
Since these changes involve sandboxing the iframe, several other exemptions were required to allow the in room experience to remain unchanged

  • allow-scripts
  • allow-same-origin
  • allow-forms
  • allow pop ups

- EDIT: this should now only be applied if you have either the recording attribute on the embed element, or recording=on in the room url:

eg:
<whereby-embed recording room={roomUrl} />

or:
<whereby-embed room="someroomurl.whereby.com?recording=on" />

Test Plan

  • Run the sdk in a test app
  • Test out the in room experience, and observe no errors in the console
  • (the local recording download functionality will come with later tasks)

@sarahrose-ferris sarahrose-ferris marked this pull request as ready for review October 24, 2023 10:03
Copy link
Contributor

@jamesdools-whereby jamesdools-whereby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all functional to me using an embedded room in a demo app 👍

@sarahrose-ferris sarahrose-ferris marked this pull request as draft October 26, 2023 09:36
Copy link
Contributor

@jamesdools-whereby jamesdools-whereby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just been testing the new local recording flow on my machine with both whereby-embed elements and plain iframes, and they download both current recordings and previously unsaved ones okay in the current context.

Not sure if we need to enable the sandbox anymore 🤔

const isLocalRecordingEnabled = this.roomUrl.searchParams.has("recording");

if (isLocalRecordingEnabled)
this.iframe.sandbox = "allow-downloads allow-same-origin allow-forms allow-scripts allow-popups";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ps. I think this should be this.iframe.current.sandbox, perhaps with some conditional checks in there first
Screenshot 2023-11-21 at 17 04 31
Screenshot 2023-11-21 at 17 04 25

@sarahrose-ferris
Copy link
Author

Closing this as it is no longer necessary since the rollout of our local recording fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants