diff --git a/src/plugins/watchTogetherAdblock.desktop/README.md b/src/plugins/youtubeAdblock.desktop/README.md similarity index 76% rename from src/plugins/watchTogetherAdblock.desktop/README.md rename to src/plugins/youtubeAdblock.desktop/README.md index 4c64df67b..d6235f36e 100644 --- a/src/plugins/watchTogetherAdblock.desktop/README.md +++ b/src/plugins/youtubeAdblock.desktop/README.md @@ -1,6 +1,7 @@ # WatchTogetherAdblock -Block ads in the YouTube WatchTogether activity via AdGuard +Block ads in YouTube embeds and the WatchTogether activity via AdGuard Note that this only works for yourself, other users in the activity will still see ads. + Powered by a modified version of [Adguard's BlockYoutubeAdsShortcut](https://github.com/AdguardTeam/BlockYouTubeAdsShortcut) diff --git a/src/plugins/watchTogetherAdblock.desktop/adguard.js b/src/plugins/youtubeAdblock.desktop/adguard.js similarity index 100% rename from src/plugins/watchTogetherAdblock.desktop/adguard.js rename to src/plugins/youtubeAdblock.desktop/adguard.js diff --git a/src/plugins/watchTogetherAdblock.desktop/index.ts b/src/plugins/youtubeAdblock.desktop/index.ts similarity index 53% rename from src/plugins/watchTogetherAdblock.desktop/index.ts rename to src/plugins/youtubeAdblock.desktop/index.ts index 2dbc13d4a..708b908d9 100644 --- a/src/plugins/watchTogetherAdblock.desktop/index.ts +++ b/src/plugins/youtubeAdblock.desktop/index.ts @@ -4,12 +4,14 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { migratePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import definePlugin from "@utils/types"; // The entire code of this plugin can be found in native.ts +migratePluginSettings("YoutubeAdblock", "WatchTogetherAdblock"); export default definePlugin({ - name: "WatchTogetherAdblock", - description: "Block ads in the YouTube WatchTogether activity via AdGuard", - authors: [Devs.ImLvna], + name: "YoutubeAdblock", + description: "Block ads in YouTube embeds and the WatchTogether activity via AdGuard", + authors: [Devs.ImLvna, Devs.Ven], }); diff --git a/src/plugins/watchTogetherAdblock.desktop/native.ts b/src/plugins/youtubeAdblock.desktop/native.ts similarity index 69% rename from src/plugins/watchTogetherAdblock.desktop/native.ts rename to src/plugins/youtubeAdblock.desktop/native.ts index c4106c349..8cc6a3232 100644 --- a/src/plugins/watchTogetherAdblock.desktop/native.ts +++ b/src/plugins/youtubeAdblock.desktop/native.ts @@ -11,9 +11,9 @@ import adguard from "file://adguard.js?minify"; app.on("browser-window-created", (_, win) => { win.webContents.on("frame-created", (_, { frame }) => { frame.once("dom-ready", () => { - if (frame.url.includes("discordsays") && frame.url.includes("youtube.com")) { - if (!RendererSettings.store.plugins?.WatchTogetherAdblock?.enabled) return; + if (!RendererSettings.store.plugins?.YoutubeAdblock?.enabled) return; + if (frame.url.includes("youtube.com/embed/") || (frame.url.includes("discordsays") && frame.url.includes("youtube.com"))) { frame.executeJavaScript(adguard); } });