Auto skip intro on amazon prime videos

No need to manually click

  1. // ==UserScript==
  2. // @name Auto skip intro on amazon prime videos
  3. // @namespace momala
  4. // @description No need to manually click
  5.  
  6. // @match https://primevideo.com/region/*/detail/*
  7. // @match https://*.primevideo.com/region/*/detail/*
  8.  
  9. // @match https://primevideo.com/detail/*
  10. // @match https://*.primevideo.com/detail/*
  11.  
  12. // @match https://amazon.com/Episode-*/dp/*
  13. // @match https://*.amazon.com/Episode-*/dp/*
  14. // @match https://amazon.co.jp/Episode-*/dp/*
  15. // @match https://*.amazon.co.jp/Episode-*/dp/*
  16. // @match https://amazon.de/Episode-*/dp/*
  17. // @match https://*.amazon.de/Episode-*/dp/*
  18. // @match https://amazon.de/dp/*
  19. // @match https://*.amazon.de/dp/*
  20.  
  21. // @match https://amazon.com/gp/video/detail/*
  22. // @match https://*.amazon.com/gp/video/detail/*
  23. // @match https://amazon.co.jp/gp/video/detail/*
  24. // @match https://*.amazon.co.jp/gp/video/detail/*
  25. // @match https://amazon.de/gp/video/detail/*
  26. // @match https://*.amazon.de/gp/video/detail/*
  27.  
  28. // @version 2
  29. // @noframes
  30. // ==/UserScript==
  31.  
  32. (function() {
  33. 'use strict';
  34.  
  35. (new MutationObserver(function (mutationlist) {
  36. if (document.querySelector('.webPlayerUIContainer [tabindex="-1"] > div:nth-child(4) > div:nth-child(3)')) {
  37. this.disconnect();
  38. console.log('Got player');
  39. (new MutationObserver(function (mutationlist) {
  40. console.log('got observer');
  41. console.log(document.querySelectorAll('.webPlayerUIContainer [tabindex="-1"] > div:nth-child(4) > div:nth-child(3) div'));
  42. Array.from(document.querySelectorAll('.webPlayerUIContainer [tabindex="-1"] > div:nth-child(4) > div:nth-child(3) div')).filter(function(item) { return window.getComputedStyle(item).getPropertyValue('box-shadow').includes('rgba'); }).forEach(function(item) {
  43. console.log('Auto skipped intro');
  44. item.click();
  45. });
  46.  
  47. })).observe(document.querySelector('.webPlayerUIContainer [tabindex="-1"] > div:nth-child(4) > div:nth-child(3)'),{ attributes: false, childList: true, subtree: true });
  48. }
  49. })).observe(document.getElementById('dv-web-player'),{ attributes: false, childList: true, subtree: true });
  50. })();