From 2ddfdcd8cffb796830ff04847f43f2bf91fb0ffc Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Sun, 10 Jun 2018 15:42:41 +0200
Subject: [PATCH] Add 'YouTube Activity Check Removal'

---
 YouTube/ActivityCheckRemoval.user.js | 35 ++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 YouTube/ActivityCheckRemoval.user.js

diff --git a/YouTube/ActivityCheckRemoval.user.js b/YouTube/ActivityCheckRemoval.user.js
new file mode 100644
index 0000000..372f353
--- /dev/null
+++ b/YouTube/ActivityCheckRemoval.user.js
@@ -0,0 +1,35 @@
+// ==UserScript==
+// @name         YouTube Activity Check Removal
+// @description  Removes activity check that interrupts video playback.
+// @version      1
+// @license      MPL-2.0
+// @namespace    https://chylex.com
+// @homepageURL  https://github.com/chylex/Userscripts
+// @supportURL   https://github.com/chylex/Userscripts/issues
+// @include      https://youtube.com/*
+// @include      https://*.youtube.com/*
+// @run-at       document-end
+// @grant        none
+// @noframes
+// ==/UserScript==
+
+var timeout = 0;
+
+var check = setInterval(function(){
+  if (_yt_www.J){
+    clearInterval(check);
+    
+    var prev = _yt_www.J;
+
+    _yt_www.J = function(cls){
+      if (cls && cls.startsWith("youthere-")){
+        return null;
+      }
+
+      return prev.apply(this, arguments);
+    };
+  }
+  else if (++timeout > 500){ // average should be about 5-10
+    clearInterval(check);
+  }
+}, 1);