We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57b7aa4 commit faa248bCopy full SHA for faa248b
src/site/youtube.ts
@@ -0,0 +1,16 @@
1
+import { AutoScroll } from "../autoscroll";
2
+
3
+export class YoutubeBehavior extends AutoScroll {
4
+ override async awaitPageLoad(ctx: any) {
5
+ const { sleep, assertContentValid } = ctx.Lib;
6
+ await sleep(10);
7
+ assertContentValid(() => {
8
+ const video = document.querySelector("video");
9
+ const paused = video && video.paused;
10
+ if (paused) {
11
+ return false;
12
+ }
13
+ return document.documentElement.outerHTML.indexOf("not a bot") === -1;
14
+ }, "no_video_playing");
15
16
+}
0 commit comments