Skip to content

Instantly share code, notes, and snippets.

@asportnoy
Last active September 30, 2024 02:17
Show Gist options
  • Save asportnoy/628b820184297f5fe296c1a5b79c8000 to your computer and use it in GitHub Desktop.
Save asportnoy/628b820184297f5fe296c1a5b79c8000 to your computer and use it in GitHub Desktop.
Open Youtube App Userscript | See https://github.com/qnblackcat/uYouPlus/issues/69
// ==UserScript==
// @name Open YouTube App
// @version 1.0.4
// @author asportnoy
// @match *://*.youtube.com/*
// @downloadURL https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000/raw/open-youtube-app.user.js
// @updateURL https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000/raw/open-youtube-app.user.js
// @homepage https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000/
// @inject-into content
// ==/UserScript==
if (window.self !== window.top) return; // iframe
if (window.location.pathname === '/redirect') return; // Opening link in browser from app
window.location.href = `youtube://${window.location.pathname.slice(1)}${
window.location.search
}${window.location.hash}`;
@sevenc-nanashi
Copy link

This did not work on my Safari, so I patched this script: https://gist.github.com/sevenc-nanashi/83d7214c43e47f9f689a9199f81f0a8e

I hope this is useful.

@asportnoy
Copy link
Author

Updated script accordingly, should be working again. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment