Repository navigation
Conversation
WooCommerce.com's Connect account answers with a redirect to woocommerce.com/oauth/authorize. Inside a window the iframe followed it, woocommerce.com refused to be framed (X-Frame-Options), and the window showed a browser error with the flow dead. A chromeless navigation that redirects to another host now gets a small hand-off page instead of the redirect. It posts os-iframe-offsite-redirect to the shell, which drops the window and takes the tab to the destination, as classic admin does. The service's return to an admin URL comes back into the shell through the portal. The page also carries a target="_top" link for a parent that does not answer. A shell the user has not interacted with yet only drops the window, so a session that restores a window on such a URL does not send the user off the desktop at boot.
The link on the hand-off page only matters when the shell cannot read its message, such as a shell loaded before the plugin was updated. It now stays hidden for a second, so the normal path paints nothing, and uses wp-admin's colours instead of the browser defaults, which were unreadable on the window's dark background.
Collaborator
Author
|
@claude review this PR |
|
Claude finished @epeicher's task in 26s —— View job Review of PR #1008: follow off-site redirects in the tabI read the diff and checked the surrounding helpers. I did not run the test suites. Overall the approach is sound and well scoped: it covers only navigations, leaves same-site redirects alone, documents the new message, and the shell side drops the window before leaving. I have a few points, mostly minor. Worth a look
Minor
Verdict: Looks good to merge once point 2 is confirmed and, ideally, one pass-through test is added for point 5. Nothing here is blocking. |
A plain admin request and a script's request inside a window keep the plain redirect; a test now holds that. The docblocks say that network siblings and allowed_redirect_hosts count as off-site, and that a browser without navigator.userActivation always follows. The bridge protocol row is shorter.
Collaborator
Author
|
Thanks for the review. Addressed in 453712b:
Minor
|
epeicher
deleted the
opensta-246-fix-woocommercecom-connection-redirect-that-breaks-the
branch
October 14, 2026 09:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Fixes Connect to WooCommerce.com breaking the window it runs in. After this change, clicking Connect account takes the browser tab to WooCommerce.com's sign-in, as classic wp-admin does. When WooCommerce.com sends you back, you land in the desktop with the WooCommerce screen open in a window.
Why
WooCommerce answers the connect request with a redirect to
woocommerce.com/…/oauth/authorize. Inside a window, the iframe followed that redirect. woocommerce.com sendsX-Frame-Options: SAMEORIGIN, so the window showed the browser's "refused to connect" page and the flow stopped. Any sign-in flow that redirects to another site from an admin page fails the same way.How
includes/core/routing.php): awp_redirectfilter catches a window's navigation (chromeless, not a script's request) that redirects to another host. It answers with a small hand-off page instead of the redirect. The page postsos-iframe-offsite-redirectwith the destination to the shell, and has atarget="_top""Continue to …" link for a parent that doesn't answer. Same-site redirects (saves, the front end, relative admin URLs) are untouched.src/window/iframe-bridge.ts): on that message, the shell drops the window and doeslocation.assign()to the destination. It drops the window without the unsaved-changes prompt, because its page has already left. A window kept in the session would reopen on the redirecting URL and send the user straight back out.navigator.userActivation.hasBeenActive === false), the window is only dropped. This happened while testing: a session saved with the broken window restored it at boot and sent the tab to woocommerce.com without a click.docs/bridge-protocol.mddocuments the new message.Testing instructions
Tests:
npm run test:php -- --filter=Tests_OpenStationChromelessPreserveRedirect(adds the off-site predicate and hand-off page cases).npm run test:js,lint,typecheckandlint:phpare green.