fix: auto-accept CSB trust interstitial for free tier (onlook-dev/onl…#3111
Conversation
- Uncomment and enable CSB free tier actions to auto-click #btn-answer-yes - Add actions parameter to Firecrawl scrapeUrl() call - This allows the Penpal connection to establish properly on CSB free tier - Fixes timeout issue where preload script couldn't be injected due to interstitial Fixes onlook-dev#3087
|
@guangyang1206 is attempting to deploy a commit to the Onlook Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesCSB Free-Tier Trust Interstitial Dismissal
🎯 2 (Simple) | ⏱️ ~5 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ook#3087)
Fixes #3087
Description
Problem
When opening a project page in self-hosted Onlook, the canvas iframe fails to establish a Penpal connection with the CodeSandbox sandbox preview. The iframe displays the CodeSandbox free-tier trust interstitial ("You are opening a CodeSandbox preview, do you want to continue?") instead of loading the app directly. Even after manually clicking "Yes, proceed to preview", the Penpal connection times out after 30 seconds.
Root Cause
Two issues contribute to this:
CSB trust interstitial is not auto-bypassed. There is commented-out code in
apps/web/client/src/server/api/routers/project/project.ts(lines 87-91) that would click the#btn-answer-yesbutton, but it is not active.Preload script not injected into the sandbox. After dismissing the interstitial, the app loads in the iframe but
onlook-preload-script.jsdoes not appear to be injected into the sandbox's public/ directory or referenced in the root layout. Without the preload script, the child-side Penpal connect() never fires, so the parent times out.Solution
This PR fixes the issue by:
Enabling CSB free tier actions: Uncomment and enable the
_csbFreeActionsarray that automatically clicks the#btn-answer-yesbutton to bypass the trust interstitial.Adding actions to Firecrawl call: Pass the
actionsparameter to theapp.scrapeUrl()call so that Firecrawl will execute these actions (clicking the trust button) before scraping the page.Changes
apps/web/client/src/server/api/routers/project/project.ts:actions: csbFreeActionsto thescrapeUrl()optionsTesting
Related Issues
Fixes #3087
Summary by CodeRabbit