Skip First 3 Seconds of Pornhub Videos

Automatically skip the first 3 seconds of every video on Pornhub when it starts playing.

  1. // ==UserScript==
  2. // @name Skip First 3 Seconds of Pornhub Videos
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Automatically skip the first 3 seconds of every video on Pornhub when it starts playing.
  6. // @author Miro
  7. // @match *://*.pornhub.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function skipVideo(video) {
  16. if (video.currentTime < 3) {
  17. video.currentTime = 3;
  18. }
  19. }
  20.  
  21. function setupSkip() {
  22. document.querySelectorAll('video').forEach(video => {
  23. video.addEventListener('play', () => skipVideo(video), { once: true });
  24. });
  25. }
  26.  
  27. // Run setupSkip when the page is loaded
  28. window.addEventListener('load', setupSkip);
  29.  
  30. // Observe the page for dynamically added videos
  31. const observer = new MutationObserver((mutations) => {
  32. mutations.forEach((mutation) => {
  33. mutation.addedNodes.forEach(node => {
  34. if (node.nodeName === 'VIDEO') {
  35. node.addEventListener('play', () => skipVideo(node), { once: true });
  36. } else if (node.querySelectorAll) {
  37. node.querySelectorAll('video').forEach(video => {
  38. video.addEventListener('play', () => skipVideo(video), { once: true });
  39. });
  40. }
  41. });
  42. });
  43. });
  44.  
  45. observer.observe(document.body, {
  46. childList: true,
  47. subtree: true,
  48. });
  49. })();