Add external communication opt-out for browser runtime#237
Add external communication opt-out for browser runtime#237genkio wants to merge 4 commits intoaidenybai:mainfrom
Conversation
|
@genkio is attempting to deploy a commit to the Million Team on Vercel. A member of the Team first needs to authorize it. |
|
This run croaked 😵 The workflow encountered an error before any progress could be reported. Please check the link below for details. |
There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/react-grab/src/utils/mount-root.ts">
<violation number="1" location="packages/react-grab/src/utils/mount-root.ts:23">
P1: The `openFile` function's new `allowExternalCommunication` parameter defaults to `true`, which means any call site that wasn't updated will silently bypass the external-communication opt-out. Two call sites in `index.tsx` and `open.ts` were updated, but verify there are no other `openFile` call sites (e.g., in `renderer.tsx` for selection-label clicks) that still pass only `filePath` and `lineNumber`.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| loadFonts(); | ||
| export const mountRoot = ( | ||
| cssText?: string, | ||
| allowExternalCommunication = true, |
There was a problem hiding this comment.
P1: The openFile function's new allowExternalCommunication parameter defaults to true, which means any call site that wasn't updated will silently bypass the external-communication opt-out. Two call sites in index.tsx and open.ts were updated, but verify there are no other openFile call sites (e.g., in renderer.tsx for selection-label clicks) that still pass only filePath and lineNumber.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/react-grab/src/utils/mount-root.ts, line 23:
<comment>The `openFile` function's new `allowExternalCommunication` parameter defaults to `true`, which means any call site that wasn't updated will silently bypass the external-communication opt-out. Two call sites in `index.tsx` and `open.ts` were updated, but verify there are no other `openFile` call sites (e.g., in `renderer.tsx` for selection-label clicks) that still pass only `filePath` and `lineNumber`.</comment>
<file context>
@@ -18,8 +18,13 @@ const loadFonts = () => {
- loadFonts();
+export const mountRoot = (
+ cssText?: string,
+ allowExternalCommunication = true,
+) => {
+ if (allowExternalCommunication) {
</file context>
There was a problem hiding this comment.
1 issue found across 5 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/react-grab/e2e/external-communication.spec.ts">
<violation number="1" location="packages/react-grab/e2e/external-communication.spec.ts:156">
P2: Silent failure risk in Playwright test due to optional chaining on DOM click inside `page.evaluate()`. If the target element is not found, the click is silently skipped and the test's negative assertion (`expect(openUrls ?? []).toEqual([])`) will falsely pass, masking regressions. The test should assert the element exists before clicking or use Playwright's native locators which automatically wait and fail if the target is not found.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
d0c6280 to
bb9da1f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Summary
Testing
Note
Medium Risk
Adds a new runtime option that gates network requests, asset loading, and open-file fallbacks; mistakes could silently break expected UX (fonts/version check/open in editor) or regress plugin behavior.
Overview
Adds an
allowExternalCommunicationoption (defaulttrue) that can be provided via scriptdata-optionsand via auto-init throughwindow.__REACT_GRAB_OPTIONS__.When disabled, the browser runtime now skips the intro version-check request (
logIntro), avoids loading remote Google Fonts (mountRoot), and prevents cross-origin HTTP(S) open-file fallbacks by plumbing the flag through the plugin registry/action context and centralizing selection-label + keyboard shortcut open behavior.Includes new Playwright e2e coverage ensuring no external requests/fonts on init and no remote
window.openfallback when the option is off.Written by Cursor Bugbot for commit c4c9aab. This will update automatically on new commits. Configure here.
Summary by cubic
Adds an
allowExternalCommunicationopt-out to the browser runtime. When disabled, it skips the version check, does not load Google Fonts, and blocks cross-origin HTTP(S) open-file fallbacks from both the keyboard shortcut and the selection label.New Features
allowExternalCommunication(defaulttrue), set viawindow.__REACT_GRAB_OPTIONS__and scriptdata-options; auto-init reads and passes it toinit.logIntro), Google Fonts (mountRoot), and open-file fallbacks via centralized open logic; plumbed through the plugin registry, action context, renderer, and plugins.window.open.Bug Fixes
allowExternalCommunication.voidfor fire-and-forget to avoid dangling promises in UI paths.Written for commit c4c9aab. Summary will update on new commits.