This repo contains the code for blocking YouTube ads that is supposed to be run by an iOS shortcut

Overview

Block YouTube Ads in Safari on iPhone/iPad

This repository contains code for the shortcut that we use to block YouTube ads on iPhone/iPad.

The problem is that Safari Content Blocking capabilities is not enough to handle YouTube ads anymore. Our last resort is using iOS Shortcuts which require some additional manual actions.

How to use this

  1. Get the shortcut. In order to install it, you need to allow untrusted shortcuts first.
  2. Open YouTube in Safari (it's important, it will only work in Safari)
  3. Click the "Share button"
  4. Choose "Block YouTube Ads (by AdGuard)" from the list of actions
  5. You probably want to make this action "Favourite". Tap "Edit actions..." and then the "Plus" icon to do that.
  6. Done! Now YouTube is ad free.

Please note, that every time you refresh the page, you need to run this shortcut again.

Remote version

With the standard version of the shortcut, you need to reinstall it to get the latest changes we make in this repo. If you are tired of doing that, there's also a "remote" version of the shortcut. It downloads the latest version of the code from this repo everytime it is launched.

Get the remote version.

Comments
  • Should we retain AdGuard branding for downstream uses?

    Should we retain AdGuard branding for downstream uses?

    Hi, I hope you don't mind if I abuse your issue tracker for this query. We're planning to use your script for Epiphany's adblocker because it works with no changes and is licensed GPLv3+ (thanks!). However, since it adds the text "with AdGuard" next to the YouTube logo, I wonder if you would prefer us to (a) do nothing and retain the AdGuard branding, or (b) debrand it. (a) gets you a little free advertising, I suppose. (b) ensures Epiphany users won't think AdGuard is to blame if the script breaks in the future, or for other problems with Epiphany's adblocker (it's just EasyList in content blocker form, which doesn't seem to be maintained super well).

    If we don't hear back soon, we'll probably include it with your branding intact. Anyway, happy to respect your preferences here. Thanks again for making this open source!

    question 
    opened by mcatanzaro 8
  • Add support for music.youtube.com

    Add support for music.youtube.com

    Issue URL (Ads)

    https://music.youtube.com/watch?v=mU2e2ct9Vhg&list=RDAMVMWf1Ho9xmlOs

    Comment

    Similar to Shortcut available for YouTube site, can we have something for music.YouTube.com as well? I must say, the shortcut on YT site works flawlessly, thanks. I was wondering if it’s scope could be expanded for music also.

    Screenshots

    Screenshot 1

    Screenshot 1

    Screenshot 2

    Screenshot 2

    System configuration

    Information | value --- | --- AdGuard product: | AdGuard/AdGuard Pro for iOS v4.1.1 Browser: | Safari DNS filtering: | disabled Filters: | Ad Blocking:
    AdGuard Base,
    AdGuard Mobile Ads

    Privacy:
    AdGuard Tracking Protection

    Social Widgets:
    AdGuard Social Media

    Annoyances:
    AdGuard Annoyances

    Security:
    Spam404,
    NoCoin Filter List

    Other:
    AdGuard Experimental,
    AdGuard DNS

    Originally posted by @adguard-bot in https://github.com/AdguardTeam/AdguardFilters/issues/83300#issuecomment-846552665

    opened by AdamWr 3
  • iOS 12.X version possible?

    iOS 12.X version possible?

    For older devices which are still good as fixed youtube screens (my use case). Attempting to add the shortcut gives a "Format Too New" error.

    question 
    opened by JasonJAyalaP 1
  • Add support for youtube-nocookie.com

    Add support for youtube-nocookie.com

    According to Google Support article, YouTube also uses the domain www.youtube-nocookie.com to serve videos (and ads!). We should add support for this domain in https://github.com/AdguardTeam/BlockYouTubeAdsShortcut/blob/2898c2a16fc1da1fb6667f45e0276a56e08cab66/index.js#L133-L146

    opened by javabean 1
  • Non intrusive script run

    Non intrusive script run

    Just a suggestion, Changing from Alert to notification removes the need of clicking OK, which kind of becomes frustrating each time shortcut is run. I did few mods, but one strange thing I noticed. When the script is run, it changes the contents of page within a second but it takes almost 3s for shortcut to complete and send notification. Not sure if it is an issue with Shortcuts app itself.

    any ideas ?

    question 
    opened by VGisHere 1
  • Is automation possible?

    Is automation possible?

    I ain’t that familiar with shortcuts and different options that we have but I was trying to run this particular shortcut with automation on condition as follows - On opening safari, if url contains “YouTube” run this shortcut else nothing. I failed at this likely because Im missing some concept here.

    The error I got stated, No web page found, cant run shortcut. I tried many things around this, but couldn’t get through. Any ideas?

    also, “with AdGuard” seems a bit too long, any shorter version will be appreciated. I changed it to “AG” for convenience in the script 😅

    question 
    opened by VGisHere 1
  • Update zh-tw

    Update zh-tw

    https://github.com/AdguardTeam/BlockYouTubeAdsShortcut/blob/master/index.js

    'zh-tw': { logo: '偕同 AdGuard', alreadyExecuted: '此捷徑已被執行。', wrongDomain: '此捷徑應該只於 YouTube 上被啟動。', success: '現在 YouTube 為無廣告的!請注意,若您重新載入該頁面,您需要再次執行此捷徑。', },

    opened by lancelot-moon 0
  • Main javascript drains battery/creates memory leaks

    Main javascript drains battery/creates memory leaks

    Hi,

    I am observing a few different issues on different Macs and an iPad with this script/shortcut:

    On iPad Pro with iPadOS 16.2 RC (and before) the battery drains very fast when using the script in youtube --> 12Min video 5-10% battery drain. Sometimes it is more, sometimes it is less. It does not matter if I integrate the .js with apps like Hyperweb or userscripts or use the shortcuts. Sometimes it is better, sometimes it is worse.

    On 3 different Macs M1 (16GB RAM), M1 Pro(16GB RAM), M2(8GB RAM) running Ventura (13.0.1 and current betas tested) I am facing the issue, that after a few mins, the youtube tasks fills up my memory with sometimes ~1GB or RAM usage, and in worst cases up 7GB usage. If I disable the .js or refresh the site, if used with the siri shortcuts action, it stays low as ~500MB for the same task with the same video.

    Any explanation, why this script uses so many resources? And if it is related to the script and/or iPadOS/macOS, is there a way to integrate it into adguard home directly?

    thx in advance for any help!

    opened by iseeblxck 0
  • Auto play issues

    Auto play issues

    Can auto play be made optional? The issue I noticed is as follows - Play video with AdGuard extension Open new tab Play another video with AdGuard extension 1st video stops, expected but sometimes may not be desirable On closing the new video tab, if tab switched to old video, old video starts playing but the play button still shows status as paused. And it takes a couple of taps if old video has to be paused.

    TLDR: request to make autoplay optional or be removed.

    feature request 
    opened by VGisHere 0
Owner
AdGuard
AdGuard
Swaps video ads for an ad-free stream.

VideoAdBlockForTwitch This video adblock for Twitch extension will swap Twitch video ads for an ad-free version of the stream at 480p and then automat

cleanlock 1.5k Jan 2, 2023
Free Anime Streaming Website Made with PHP and Gogoanime API. No Video ads

AniKatsu - Watch High Quality Anime Online Without Ads Demo https://anikatsu.ga This is a PHP application used for browsing, searching and watching an

Shashank Tiwari 34 Nov 7, 2022
A browser extension to skip intro, recap and ads on video streaming plaforms

AIO Skipper AIO skipper is a browser extension made for ?? binge watchers ?? . It automatically skip intro, recaps and ads in Netflix, Prime Video, Di

null 6 Nov 2, 2022
Remote Code Execution V1 For iOS 15 sent through airdrop after the device was connected to a trusted host

iOS 15.0.1 RCE V1 Author: Jonathan Scott @jonathandata1 Date: October 9th, 2021 Release Version 1.0 Description When an iOS device has been connected

Jonathan Scott 307 Dec 26, 2022
This Is A Simple WhatsApp Bot Mode From *DhaniGans* Repo Hope you guys Will like it Repo Updates in Every Two Days

ALIEN ALFA BOT Contact Me: Scan QR Code For Session FORK THIS BEFORE PROCEEDING Use This Button To Fork Now THINGS TO CHANGE IN HEROKU ???????????? ??

TOXIC ALIEN 15 Dec 21, 2022
It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with buttons. It can play youtube songs, playlists. This bot code was made by Supreme#2401. It uses djs V12

Lofi-Radio-Music-Bot It is a discord bot bot which can play lofi song in different language 24/7. It has premium system and cool embed looks with butt

Diwas Atreya 89 Jan 2, 2023
Source code for a girlfriend bot that you can talk to in VC, video can be found on youtube

Girlfriend Bot This repo is basically the source code for the main youtube video which was basically me creating a girlfriend that i can talk to in VC

UltraX 16 Dec 2, 2022
Mikasa Açkerman's source code, public repo.

I dont know how to fucking make bots, dont ask me! Ne bakıyorsun lan, simit var ekmek var poğaça var ne bakıyon? To use that source code you need to d

thumbsup 6 Dec 24, 2022
A quick-start template for Discord.js v14 in TypeScript that contains handling for commands, events, and interactions!

Typescript-Discord.js-v14-Template A quick-start template for Discord.js v14 in Typescript that contains handling for commands, events, and interactio

Delta 23 Dec 28, 2022
▶️ Streams a list of tracks from Youtube, Soundcloud, Vimeo...

PlayemJS PlayemJS is a front-end JavaScript component that manages a audio/video track queue and plays those tracks sequentially. It can currently pla

Adrien Joly 90 Nov 27, 2022
Rule YouTube, Soundcloud and Vimeo player with one API

Polyplayer Polyplayer allows you to rule YouTube's, Soundcloud's and Vimeo's player using one API. Features Playing, pausing, stopping Seek to absolut

Marius 41 Sep 24, 2022
HTML5

One file. Any browser. Same UI. Author: John Dyer http://j.hn/ Website: http://mediaelementjs.com/ License: MIT Meaning: Use everywhere, keep copyrigh

MediaElement.js 8k Dec 27, 2022
A simple HTML5, YouTube and Vimeo player

Plyr is a simple, lightweight, accessible and customizable HTML5, YouTube and Vimeo media player that supports modern browsers. Checkout the demo - Do

Sam Potts 23.1k Jan 3, 2023
HTML5

One file. Any browser. Same UI. Author: John Dyer http://j.hn/ Website: http://mediaelementjs.com/ License: MIT Meaning: Use everywhere, keep copyrigh

MediaElement.js 8k Jan 8, 2023
A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion

ReactPlayer A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, M

Pete Cook 7.2k Jan 4, 2023
Watch youtube, play poker and many others games together!

THE GAMES ARE FROM DISCORD STOP MESSAGING ME ABOUT IT! Powercord Together A plugin that makes easy to watch youtube, play poker and many others games

notsapinho 66 Nov 25, 2022
Play games or watch YouTube videos together on Discord !

Discord Together ?? Installation Install discord-together $ npm install discord-together@latest Install discord.js $ npm install discord.js ?? Featu

RemyK 186 Jan 3, 2023
Tonton video tutorial di YouTube saya untuk cara penginstalan & apabila kurang mengerti bisa hubungi saya di WhatsApp 🐣Klik link di bawah untuk tutorial penginstalan di heroku

BOTZ10 LAST Termux • Heroku • Session Setting • Thanks TERMUX Git clone this repo > git clone https://github.com/zeeoneofc/BOTZ10a.git > cd BOTZ10a >

zeeone 17 Dec 23, 2021
Umut Bayraktar YouTube Özel Discord.js v13 Uyumlu Başvuru Botu Altyapısı, Glitch ve PC Uyumludur!

Discord.js v13 Başvuru Botu Umut Bayraktar Youtube Özel Discord.js v13 Başvuru Botu Altyapısı. Glitch.com'da Kullanacak İseniz .env İsimli Dosyaya Bot

Umut Bayraktar 6 May 31, 2022