Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Userscript to automatically prompt to open YouTube app #69

Closed
asportnoy opened this issue Feb 24, 2022 · 20 comments
Closed
Labels
enhancement New feature or request

Comments

@asportnoy
Copy link

asportnoy commented Feb 24, 2022

I made a userscript to automatically prompt you to open the YouTube app when you open a YouTube link in safari. I already had a Siri shortcut to do this, but I prefer this because it will automatically prompt you instead of having to dig through the share menu.

Safari extension to run user script (free): https://apps.apple.com/us/app/userscripts/id1463298887
Userscript code: https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000

How to install

  1. Install the app
  2. Launch the app and choose path for scripts
  3. Go to this page
  4. Open the extension and press install in the banner
@qnblackcat qnblackcat added the enhancement New feature or request label Feb 25, 2022
@qnblackcat qnblackcat changed the title Userscript to automatically prompt to open YouTube app [Enhancement] Userscript to automatically prompt to open YouTube app Feb 25, 2022
@qnblackcat qnblackcat pinned this issue Feb 25, 2022
@Write
Copy link

Write commented Mar 12, 2022

Thanks a lot for this script.
Would it be possible to add a way to open directly the link in the app, like Apollo app is doing ?

@asportnoy
Copy link
Author

Automatic open in app (including from Apollo) works by using Apple's smart banners. Those require you to get the app ID, which only app store apps have.

@Write
Copy link

Write commented Mar 12, 2022

Ok thanks a lot !

@tonysprenk
Copy link

tonysprenk commented Mar 15, 2022

I have downloaded the userscript extension, I have enabled it, I have set the userscript directory, I have downloaded the above script to the directory. When I open a YouTube link I don’t get the open in YouTube pop-up, what am I doing wrong?

@ilm91
Copy link

ilm91 commented Mar 21, 2022

Awesome! Can you write a code for BHTwitter+ too, which do the same thing, but for the modified Twitter "BHTwitter Plus"?

BHTwitter Plus: https://github.com/qnblackcat/BHTwitter-Plus_Sideloaded/#download-ipa

@qnblackcat
Copy link
Owner

@asportnoy I‘ve added your solution to the FAQ page.
https://github.com/qnblackcat/uYouPlus/wiki/FAQ#q-deep-link-aka-open-in-the-youtube-app-doesnt-work

@asportnoy
Copy link
Author

Awesome! Can you write a code for BHTwitter+ too, which do the same thing, but for the modified Twitter "BHTwitter Plus"?

BHTwitter Plus: https://github.com/qnblackcat/BHTwitter-Plus_Sideloaded/#download-ipa

@ilm91 With Twitter, you would have to do more parsing of the URL to format it into the URL scheme. The URL schemes for Twitter are listed here.

@qnblackcat
Copy link
Owner

Technically , this is not an issue. I’ll close it but still keep it pinned.

@fefifofum
Copy link

Maybe this is worth checking out...

https://github.com/CokePokes/YoutubeExtensions

@qnblackcat
Copy link
Owner

YouTubeExtensions (by CokePokes) has been added since v17.17.4-2.1. This user script is most likely not needed anymore.

@anhnlh
Copy link

anhnlh commented Sep 12, 2022

Hey is it possible to modify the script code to also close the tab in safari as well?

Sorry for opening the issue up again, I wanted to ask because I can't set up YoutubeExtensions by CokePokes

@codexss
Copy link

codexss commented Oct 12, 2022

Awesome! Can you write a code for BHTwitter+ too, which do the same thing, but for the modified Twitter "BHTwitter Plus"?

BHTwitter Plus: https://github.com/qnblackcat/BHTwitter-Plus_Sideloaded/#download-ipa

https://gist.github.com/codexss/eb5ae8fa5ff85112e091d6f4e0f48f3f

Try this

@anhnlh
Copy link

anhnlh commented Oct 12, 2022

That didn't really help, but I added an update to the script that closes the tab after 5 seconds. You should be able to tap the open in app button quick enough for the tab to close by itself lol. It seems like it's working for me.

Modified script: https://gist.github.com/aln4739/2c04dc54d09e68c73eaccf13266950a1

@dudu-castro
Copy link

I made a userscript to automatically prompt you to open the YouTube app when you open a YouTube link in safari. I already had a Siri shortcut to do this, but I prefer this because it will automatically prompt you instead of having to dig through the share menu.

Safari extension to run user script (free): https://apps.apple.com/us/app/userscripts/id1463298887 Userscript code: https://gist.github.com/asportnoy/628b820184297f5fe296c1a5b79c8000

How to install

  1. Install the app
  2. Launch the app and choose path for scripts
  3. Go to this page
  4. Open the extension and press install in the banner

Hey bro, how can I do a userscript to open Rocket Instagram and Tiktok automatically as you do? Can u help me?

@lui75
Copy link

lui75 commented Apr 19, 2023

Hi! Would it be possible for you to modify the script in order to let it works with Chrome too? Thanks for your time.

@yodaluca23
Copy link

Hi! Would it be possible for you to modify the script in order to let it works with Chrome too? Thanks for your time.

Bro, extensions only work in Safari, dummy...

@ryuya0124
Copy link

Some YouTube channel pages (youtube://www.youtube.com/@....) Fixed because it does not work correctly on

https://gist.github.com/ryuya0124/2ba4f56cf9e9dab781d3146c74a3f36b

@asportnoy
Copy link
Author

Some YouTube channel pages (youtube://www.youtube.com/@....) Fixed because it does not work correctly on

https://gist.github.com/ryuya0124/2ba4f56cf9e9dab781d3146c74a3f36b

I can't reproduce that issue, it works on my version too.

@ryuya0124
Copy link

I wrote a script for BHTwitter.
It analyzes the URL scheme and opens more pages.
The list redirects to the timeline because the URL scheme is unknown.
Pages that could not be handled are also redirected to the timeline to avoid errors.

https://gist.github.com/ryuya0124/e6e59ceba8f03bf40f3b5accedc52e44

@ryuya0124
Copy link

Some YouTube channel pages (youtube://www.youtube.com/@....) Fixed because it does not work correctly on
https://gist.github.com/ryuya0124/2ba4f56cf9e9dab781d3146c74a3f36b

I can't reproduce that issue, it works on my version too.

In older versions, for example, if you opened this link, the YouTube app could not process it and redirected you to the browser.

https://youtube.com/@wdsgame_official?si=m7_Yk-Vj02go6ozm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests