Skip to content

make BrowserCode embeddable - #35

Open
rijulshrestha wants to merge 5 commits into
mainfrom
embed-options
Open

rijulshrestha wants to merge 5 commits into
mainfrom
embed-options

Conversation

@rijulshrestha

@rijulshrestha rijulshrestha commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Adds /embed that composes the IDE or a CLI agent from the query string.

<iframe src="https://browsercode.io/embed?repo=github.com/user/repo&view=preview"
        allow="cross-origin-isolated"></iframe>
  • agent / repo / framework picks what boots, view picks the panes.
  • Adds a crossOriginIsolated check, so a host page missing the headers gets a clear message instead of an opaque boot failure.

Embedders must send COOP: same-origin and COEP: require-corp on their own page.

@rijulshrestha rijulshrestha changed the title Add an embeddable /embed route Add an embeddable /embed route with per-pane shell options Sep 14, 2026
@rijulshrestha rijulshrestha self-assigned this Sep 14, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 14, 2026

Copy link
Copy Markdown

Deploying browsercode with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0f4d6e3
Status: ✅  Deploy successful!
Preview URL: https://ef1d7a35.browsercode.pages.dev
Branch Preview URL: https://embed-options.browsercode.pages.dev

View logs

@rijulshrestha rijulshrestha changed the title Add an embeddable /embed route with per-pane shell options make BrowserCode embeddable Sep 14, 2026
@rijulshrestha

rijulshrestha commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@GabrielaReyna I've created a separate docs folder containing some instructions on how to embed for now. Should we have this here in the repo, or just have it in the browserpod docs?

@rijulshrestha
rijulshrestha marked this pull request as ready for review September 14, 2026 13:14

@GabrielaReyna GabrielaReyna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Rijul,

Thanks for working on this. I tested the embeddable components and they look great!

  • Please address the opaque failure for agents when the headers are not set
  • About your question on the documentation, please display it on the read me, or add a link to the md file from the readme. We will have a dedicated doc content in BrowserCode but this should do for this PR.
  • On the message when the headers are not set, please add a link to "Learn more" that points to this repo.
  • The 'Nothing to boot" message text is overflowing, please adjust it.
Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

podBlocker() is not being imported in AgentShell as you do in IdeShell. Hence if the headers are not set correctly in the host site and an agent is embedded, it won't throw the intended message and the failure is opaque. Please correct this.

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