new plugin YoutubeAdblock: blocks ads in embeds (formerly WatchTogetherAdblock)
This commit is contained in:
parent
2658459a98
commit
0f8d21a846
4 changed files with 9 additions and 6 deletions
|
@ -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)
|
|
@ -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],
|
||||
});
|
|
@ -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);
|
||||
}
|
||||
});
|
Loading…
Reference in a new issue