Twitter/X → LiveContainer (iOS)

Redirect Twitter/X links to LiveContainer so they open in the containerized Twitter/X app.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
sharmanhall
日安装量
0
总安装量
1
评分
0 0 0
版本
0.6
创建于
2025-09-23
更新于
2025-09-23
大小
4.9 KB
许可证
MIT
适用于
所有网站

Twitter/X → LiveContainer (iOS)

Redirect any Twitter/X HTTPS link to the LiveContainer app on iOS so it opens in your containerized X/Twitter. No tracking, no external requests—just smart link handling.

Author: @sharmanhall


What it does

  • Auto-redirects when you’re browsing x.com or twitter.com in Safari to LiveContainer.
  • Rewrites Twitter/X links on any site so tapping them opens X/Twitter inside LiveContainer.
  • Honors data-expanded-url on anchors (useful when a link is shown as t.co but expands to an X/Twitter URL).
  • Uses the LC scheme:
    livecontainer://open-web-page?url=BASE64(https://…twitter/x link…)
  • Adds a tiny lc=1 guard to avoid bounce loops.
  • Catches dynamically inserted links (MutationObserver) and uses a global capture fallback for delegated clicks.
  • iOS-only safeguard (won’t trigger on desktop).
  • Runs at document-start for quicker, more reliable redirects.

Requirements

  • iPhone/iPad with Safari.
  • LiveContainer installed.
  • Twitter/X installed inside LiveContainer.
  • A userscript manager on iOS:
    • Tampermonkey for Safari, or
    • The free Userscripts app.

How to use

  1. Install/enable this userscript.
  2. Make sure Twitter/X is installed in LiveContainer.
  3. Visit any x.com / twitter.com page or tap an X/Twitter link anywhere.
    → Safari hands it to LiveContainer, which opens X/Twitter in the container.

Options (edit at top of script)

  • VERBOSE – console logging.
  • AUTO_REDIRECT_ON_TWITTER_PAGES – bounce automatically when already on x.com/twitter.com.
  • REWRITE_LINKS_ON_ALL_PAGES – intercept Twitter/X links anywhere.
  • ADD_LC_FLAG – append lc=1 to prevent back/forward loops.

Privacy

  • No analytics, no remote calls.
  • Operates entirely on-device by intercepting clicks and changing navigation.

Known limitations / notes

  • This script targets HTTPS Twitter/X links. It does not chase arbitrary t.co shortlinks off-domain.
    However, if a page exposes an expanded URL via data-expanded-url that points to X/Twitter, the script will use it.
  • If nothing happens when tapping a link, confirm:
    • LiveContainer is installed and opens via livecontainer:// URLs.
    • X/Twitter is present inside LiveContainer and can handle https://twitter.com / https://x.com links via “Open in App”.

Uninstall / disable

  • Turn off the script in your userscript manager.
  • Or set AUTO_REDIRECT_ON_TWITTER_PAGES = false to keep browsing the website but still rewrite links elsewhere.

Changelog

  • v0.5@run-at document-start, @noframes, double-hook guard, global click fallback, safer Base64, data-expanded-url support.
  • v0.4 – First public release: auto-redirect, link rewriting, loop guard, dynamic link handling, iOS check.

License

MIT