-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix(desktop): oauth popups open from the browser preview #8435
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -92,7 +92,6 @@ export function HostedBrowserWebview(props: { | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| const setWebviewRef = useCallback((node: HTMLElement | null) => { | ||||||||||||||||||||||
| webviewRef.current = node as ElectronWebview | null; | ||||||||||||||||||||||
| if (node && !node.hasAttribute("allowpopups")) node.setAttribute("allowpopups", "true"); | ||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| useEffect(() => { | ||||||||||||||||||||||
|
|
@@ -259,6 +258,10 @@ export function HostedBrowserWebview(props: { | |||||||||||||||||||||
| <webview | ||||||||||||||||||||||
| key={webviewGeneration} | ||||||||||||||||||||||
| ref={setWebviewRef} | ||||||||||||||||||||||
| // Must be an attribute on the element itself: Electron reads it when the | ||||||||||||||||||||||
| // guest attaches, so setting it from the ref callback lands too late and | ||||||||||||||||||||||
| // the guest attaches with popups disabled. | ||||||||||||||||||||||
| allowpopups="true" | ||||||||||||||||||||||
|
Comment on lines
+261
to
+264
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving Suggest keeping the string value and spreading it past the boolean type (same shape already used below for
Suggested change
Posted via Macroscope — UI Consistency |
||||||||||||||||||||||
| src={webviewGeneration === 0 ? initialSrc : recoverySrc} | ||||||||||||||||||||||
| partition={config.partition} | ||||||||||||||||||||||
| webpreferences={config.webPreferences} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
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.
Popup may inherit picker preload
High Severity
POPUP_WINDOW_OPTIONSoverrides isolation flags but never clearspreload. Electron mergesoverrideBrowserWindowOptionswith the guest's preferences, so the picker preload can still run in the OAuth window and observe keystrokes and clicks on a third-party login page.Additional Locations (1)
apps/desktop/src/preview/Manager.ts#L1769-L1771Reviewed by Cursor Bugbot for commit 0604de5. Configure here.