0x48piraj / 0x48piraj/fadblock

Feature Request: Skip Current Video Segment in Video Player (Ad or Video) via Hotkeys

未关闭
#117 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
CSS
星标
2.4k
派生
109
PR 合并指标
30 天内没有已合并 PR

描述

Hello Piraj,

I hope you're doing super good.

I was looking at the repo, and I was wondering if we could call the next block of code via hot keys (i.e. "A" + "S")..

```
function skipCurrentVideoSegment() {
videoPlayer.muted = true; // videoPlayer.volume = 0;
videoPlayer.currentTime = videoPlayer.duration - 0.1;
videoPlayer.paused && videoPlayer.play()

// CLICK ON THE SKIP AD BTN
document.querySelector(".ytp-ad-skip-button")?.click();
document.querySelector(".ytp-ad-skip-button-modern")?.click();
}

addEventListener("keydown", (event) => {
if (event.key === "a") {
keys.a = true;
}
if (event.key === "s") {
keys.s = true;
}

if(keys.a && keys.s){
skipCurrentVideoSegment();
}
});
```

I think doing it this way would at least suppress the current video ad regardless of finding the cssAttributes for an ad or not.

Once the user presses the hotkeys we do this:

videoPlayer.muted = true; // videoPlayer.volume = 0;
videoPlayer.currentTime = videoPlayer.duration - 0.1;
videoPlayer.paused && videoPlayer.play()

It can leverage the pain while the extension catches up with new youtube's countermeasures.

Let me know if I can be a help.

贡献指南

这个仓库没有索引到贡献指南

调研方向

The issue suggests adding a hotkey combination (A+S) to skip video segments. Look at the existing extension's content scripts for video player interaction and key event handling. The provided code snippet shows the skipCurrentVideoSegment function; integrate it with the extension's existing event listeners. Test by loading the extension on YouTube and verifying the hotkey triggers the skip behavior without breaking existing ad-blocking functionality.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。