Repository navigation
Phones/tablets: social links open a new tab that closes itself if an app takes over - #230
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
ios-same-tab
branch
2 times, most recently
from
October 21, 2026 04:35
09ad62b to
8e719f7
Compare
github-actions
Bot
force-pushed
the
ios-same-tab
branch
2 times, most recently
from
October 23, 2026 19:18
083b56e to
cd007e7
Compare
darkmastermindz
force-pushed
the
ios-same-tab
branch
from
October 23, 2026 19:21
cd007e7 to
6062fc6
Compare
github-actions
Bot
force-pushed
the
ios-same-tab
branch
from
October 23, 2026 21:49
6062fc6 to
3c31d63
Compare
darkmastermindz
force-pushed
the
ios-same-tab
branch
from
October 24, 2026 20:52
3c31d63 to
3c06fa8
Compare
github-actions
Bot
force-pushed
the
ios-same-tab
branch
2 times, most recently
from
October 24, 2026 21:11
1a6802e to
9b648ed
Compare
Owner
Author
|
@claude rebase |
darkmastermindz
force-pushed
the
ios-same-tab
branch
from
October 24, 2026 23:30
9b648ed to
ad43e66
Compare
Owner
Author
|
Android touch (1/4) and (3/4) failed on
Generated by Claude Code |
github-actions
Bot
force-pushed
the
ios-same-tab
branch
2 times, most recently
from
October 25, 2026 02:02
2c4ad67 to
82a4240
Compare
…e no blank tab On iPhone Safari the Mastodon pill (hansel.run/mastodon) opened a new tab, iOS handed the redirect to the Mastodon app, and the tab was left blank. On iPhone and iPad the social links (and the Instagram menu) now open in the same tab: the app takes over and Safari stays on the site, or the page loads there and Back returns. Other platforms keep new tabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
… takes over Replaces the same-tab approach. On phones and tablets each social link opens /out/<id> in a new tab, a small hand-off page that goes on to the link. When the phone hands the link to an app instead (Mastodon via hansel.run, Instagram, Messenger...), the tab stays on the hand-off page, and once the visitor comes back it closes itself rather than staying blank. Back from a profile doesn't bounce into the link again. The addresses move to utils/outbound.js; the id in the path only ever names one of them (Object.hasOwn), so the page can't redirect anywhere else. One page per id is prerendered, and /out is kept out of robots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
github-actions
Bot
force-pushed
the
ios-same-tab
branch
from
October 25, 2026 02:02
82a4240 to
4ffc557
Compare
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
On iPhone Safari, tapping the Mastodon pill (
https://hansel.run/mastodon) left a blank tab behind. Here's why:The same happens with any link whose site has an app (Instagram, Messenger, LinkedIn, Strava, GitHub), and on Android too.
Links still open in a new tab. On phones and tablets, that tab first loads a small hanselwei.dev hand-off page,
/out/<id>, which goes straight on to the link:This replaces this PR's first version, which opened the links in the same tab.
Related Issue
None. The user reported it directly.
Changes Made
utils/outbound.jswith the social link addresses by id (github,mastodon,instagram,instagram-codes...), plusoutboundFor(id)(Object.hasOwn) andoutPath(id).pages/out/[id].vue, the hand-off page. It shows "Opening Mastodon…" with a link back to the site, and sends the tab on to the link.window.close(). Where it can't close the tab, it goes back (or to the home page).history.statemarker and the bfcachepageshowhandle this.noindex, and/outis disallowed inrobots.txt.Opening… · Hansel Wei, matching the site's title format from Tab titles end with "Hansel Wei" #239.nuxt.config.jsprerenders one/out/<id>page per id. I used the path rather than?to=because Nuxt briefly drops the query string while starting up.utils/mobileDevice.js:isAppleMobilecounts iPhone, iPad, iPod, and iPadOS in desktop mode.handsOffToAppscounts those plus Android.components/SocialFlipLink.vue: once the page has loaded on a phone or tablet, the pill and the Instagram menu links point at/out/<id>. The prerendered HTML (what crawlers see) keeps the real addresses.components/Socials.vuetakes its addresses fromutils/outbound.js.tests/app/mobile-device.test.mjs: which devices count.tests/security/outbound.test.mjs, with anOUTBOUND_IDSpayload list: only known ids lead anywhere. URLs,javascript:, path tricks, prototype keys and XSS all give nothing, and every address is https.README.md: the social links paragraph.main, so it no longer shows in this diff.pages/projects.vue): the selected Projects chip's count is readable on the purple (#e9d5ff, 6.2:1).main's a11y spec (Accessibility: fix every axe (WCAG 2.1 AA) issue, plus an a11y regression test #243), not from this PR.Testing
main(f0f9324, after Accessibility: fix every axe (WCAG 2.1 AA) issue, plus an a11y regression test #243, Safari and iPhone Duo fixes for the foldable layouts #246 and Celebrate iPhone Duo: a laptop lid with the site's QR, and Fold Pong #247), with the commits signed.nuxt.config.js:main's foldable head-script import and this PR'sOUTBOUNDimport. Both are kept.npm test: 259 pass, including with the Accessibility: readable count on the selected Projects chip #249 port.npm run generate: OK.https://hansel.run/mastodon/out/mastodon/out/mastodonOn phones, the Instagram menu links are
/out/instagramand/out/instagram-codes.Additional Information
🤖 Generated with Claude Code
https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS