-
Notifications
You must be signed in to change notification settings - Fork 454
fix: The method of opening the development application window is modified #1753
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
Conversation
WalkthroughOpenApplication in Main.vue now detects iframe context; if inside an iframe it sends a postMessage to the parent window to request opening the app, otherwise it calls window.open with the constructed URL. Tenant parameter logic is unchanged. Changes
Sequence DiagramsequenceDiagram
participant App as OpenApplication (Main.vue)
participant Page as Iframe Page
participant Parent as Parent Window
participant NewTab as Browser / New Tab
App->>Page: detect if in iframe
alt inside iframe
App->>Parent: postMessage({ type, id, tenant })
Parent->>NewTab: open new tab with constructed URL
else not in iframe
App->>NewTab: window.open(constructed URL)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/workspace/application-center/src/Main.vue`:
- Around line 211-221: The postMessage call currently uses '*' which is
insecure; update the window.parent.postMessage invocation (the one sending
{type:'openAppNewTab', data:{id: template.id, tenantId: template.tenantId ||
queryParams.get('tenant')}}) to use an explicit parent origin instead of '*' by
deriving/validating the expected origin (e.g., from a configured ALLOWED_ORIGINS
list, a runtime-configured parentOrigin variable, or by checking
document.referrer) and only call postMessage when the parent origin matches an
allowed origin; ensure the code references the same symbols (template.id,
template.tenantId, queryParams.get) and fails safe (do not send the message if
the origin is not known/allowed).
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.