Repository navigation
fix: update X share link and stub X in e2e test - #230
Merged
Merged
Conversation
imblue-dabadee
marked this pull request as ready for review
October 29, 2026 16:57
imblue-dabadee
enabled auto-merge (squash)
October 29, 2026 17:18
adonesky1
approved these changes
Oct 29, 2026
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.
Summary
Point the "share on X" link directly at X's current share page and stop the e2e test from depending on the live X site, which is currently failing CI on every PR.
Problem
redirects to X share page when clickedfails in every browser onmain, so every PR is red — including #229. The link openedhttps://twitter.com/intent/tweet?...and the test waited for X's own redirects to land onx.com/intent/post. X now sends that traffic elsewhere, so the popup ends up on one of:x.com/intent/tweet?...— X no longer completes the redirect to/intent/postx.com/i/jf/onboarding/web?redirect_after_login=...&mode=login— X's login wallchrome-error://chromewebdata/— the request failed on the CI runnerNone of these are caused by this repo. The link itself was also stale: it relied on X redirecting the legacy Twitter URL.
Solution
https://x.com/intent/postwith the same pre-filled text. The shared link is nowhttps://metamask.com:metamask.ioredirects there andmetamask.comis the canonical domain. The!in the text is percent-encoded as%21, so the URL survives being copied into a shell or other tools; the decoded post is unchanged.target="_blank"andrel="noopener noreferrer"are unchanged.https://x.com/**with an empty page viacontext.route, so it checks only what this page controls: clicking opens a new tab at the exact share URL. It no longer makes any network request to X.relcontainingnoopener, and that the opened tab has nowindow.opener. A phishing warning page must not let a page it opens navigate it. Both are checked because modern browsers already treattarget="_blank"as no-opener, so thewindow.openercheck alone would still pass ifrelwere removed.htmlreporter set toopen: 'never'. On a local failure, the defaulton-failureserves the report on port 9323 and keeps the process running until Ctrl+C, so a failed run looks like a hang. The report is still written toplaywright-report/and can be opened withyarn playwright show-report. CI is unaffected.The test no longer catches X itself changing or breaking its share endpoint. That's intentional, since it's outside this repo's control.
Risk
metamask.cominstead ofmetamask.io. The pre-filled text is identical.Verification
yarn lintpassesrel="noopener noreferrer"is removed from the linktwitter.com/intent/tweetURLredirect_after_loginRefs PSAFE-759. Unblocks #229.