codesandbox / codesandbox/codesandbox-client

[FR] add iFrame allow to CodeSandbox extension

Open
#6,188 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🌈 Feature

Please make the browser preview behave more like a full browser by removing X-Frame options, which blocks working on Oauth/SAML and other federated features.

https://codesandbox.io/s/builtin-browser-bug-y02x9?file=/src/index.ts

Before Removing X-Frame-options:
Screenshot 2021-10-08 11 23 51

There is an extension that already does it here:
https://chrome.google.com/webstore/detail/iframe-allow/gifgpciglhhpmeefjdmlpboipkibhbjg

But its security is bit lax. The CSB extension should only do it within the embedded browser preview or only on our Sandboxes.

For linkedIn and youtube you'll might also have to remove the CSP frameblock.
Refused to frame 'https://accounts.youtube.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://accounts.google.com".

After you install an Allow iFrame extension that removes X-Frame-options... which is what I'm proposing the CSB browser extension to do for iFrame document requests made inside the Sandbox browser:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodeSandbox example at codesandbox.io/s/builtin-browser-bug-y02x9 and its referenced src/index.ts, then locate the browser preview and extension entry points in this repository. Review how iframe document requests are handled and define the restriction to embedded previews or CodeSandbox Sandboxes. Done means OAuth/SAML and other federated previews work while unrelated browsing remains protected, including the noted CSP cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.