Redirect Twitter/X links to LiveContainer so they open in the containerized Twitter/X app.
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
x.com or twitter.com in Safari to LiveContainer.data-expanded-url on anchors (useful when a link is shown as t.co but expands to an X/Twitter URL).livecontainer://open-web-page?url=BASE64(https://…twitter/x link…)lc=1 guard to avoid bounce loops.x.com / twitter.com page or tap an X/Twitter link anywhere.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.t.co shortlinks off-domain.data-expanded-url that points to X/Twitter, the script will use it.livecontainer:// URLs.https://twitter.com / https://x.com links via “Open in App”.AUTO_REDIRECT_ON_TWITTER_PAGES = false to keep browsing the website but still rewrite links elsewhere.@run-at document-start, @noframes, double-hook guard, global click fallback, safer Base64, data-expanded-url support.MIT