Youtube - skip to time in Url param

01/09/2024, 1:04:43 pm

  1. // ==UserScript==
  2. // @name Youtube - skip to time in Url param
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.youtube.com/watch*
  5. // @grant GM_registerMenuCommand
  6. // @version 1.0
  7. // @author -
  8. // @license MIT
  9. // @description 01/09/2024, 1:04:43 pm
  10. // ==/UserScript==
  11.  
  12.  
  13. function setVideoTime(){
  14. let qp = new URLSearchParams(window.location.href);
  15. if (qp.has("t")){
  16. var time = Number(qp.get("t").replace("s",""))
  17. document.querySelector('video').currentTime = time
  18.  
  19. }
  20. }
  21.  
  22.  
  23.  
  24. GM_registerMenuCommand('Set video time to url param', setVideoTime)
  25.  
  26.  
  27.