🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

YouTube → LiveContainer (iOS)

Redirect YouTube links to LiveContainer so they open in the containerized YouTube app.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Author
sharmanhall
Daily installs
0
Total installs
11
Ratings
0 0 0
Version
0.5
Created
2025-09-23
Updated
2025-09-23
Size
4.7 KB
License
MIT
Applies to
All sites

YouTube → LiveContainer (iOS)

Redirect any YouTube HTTPS link (including youtu.be) to the LiveContainer app on iOS so it opens in your containerized YouTube. No tracking, no external requests—just smart link handling.

Author: @sharmanhall


What it does

  • Auto-redirects when you’re browsing youtube.com / youtu.be in Safari to LiveContainer.
  • Rewrites YouTube links on any site so tapping them opens YouTube inside LiveContainer.
  • Uses the LC scheme:
    livecontainer://open-web-page?url=BASE64(https://…youtube or youtu.be 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.
  • @noframes so embeds/ads in iframes aren’t touched.

Requirements

  • iPhone/iPad with Safari.
  • LiveContainer installed.
  • YouTube 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 YouTube is installed in LiveContainer.
  3. Visit any youtube.com / youtu.be page or tap a YouTube link anywhere.
    → Safari hands it to LiveContainer, which opens YouTube in the container.

Options (edit at top of script)

  • VERBOSE – console logging.
  • AUTO_REDIRECT_ON_YOUTUBE_PAGES – bounce automatically when already on YouTube.
  • REWRITE_LINKS_ON_ALL_PAGES – intercept YouTube 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 YouTube links (youtube.com and youtu.be).
    It does not chase arbitrary third-party shorteners unless the page exposes an expanded URL attribute pointing to YouTube.
  • If nothing happens when tapping a link, confirm:
    • LiveContainer is installed and opens via livecontainer:// URLs.
    • YouTube is present inside LiveContainer and can handle https://youtube.com links via “Open in App”.

Uninstall / disable

  • Turn off the script in your userscript manager.
  • Or set AUTO_REDIRECT_ON_YOUTUBE_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.
  • v0.4 – First public release: auto-redirect, link rewriting, loop guard, dynamic link handling, iOS check.

License

MIT