Kamiikaze

Tampermonkey | YT Magic Actions - Bottom Nav

Feb 15th, 2022 (edited)
1,468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         YT Magic Actions - Bottom Nav
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.2
  5. // @description  Bar position on the bottom. Pastebin: https://pastebin.com/bSr0gFpz
  6. // @author       Kamikaze
  7. // @match        https://www.youtube.com/watch?v=*
  8. // @icon         https://t2.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://youtube.com&size=16
  9. // @require      http://code.jquery.com/jquery-latest.js
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. function waitForElement(elementPath, callBack){
  14.   window.setTimeout(() => {
  15.     if($(elementPath).length){
  16.         setTimeout(() => {
  17.             callBack(elementPath, $(elementPath));
  18.         }, 3000)
  19.     }else{
  20.       waitForElement(elementPath, callBack);
  21.     }
  22.   }, 500)
  23. }
  24.  
  25.  
  26. // Moving Div below Video
  27. waitForElement("#primary", () => {
  28.     document.getElementById('primary').prepend(document.getElementById('watch7-content'))
  29. });
Add Comment
Please, Sign In to add comment