Xhamster - AUTO Video Infinite Replay (IA) v.8

Video Auto Infinite Replay (With Help of IA DuckduckGo)- Revert previous version

// ==UserScript==
// @name            Xhamster - AUTO Video Infinite Replay (IA) v.8
// @version         v.8.0
// @description	    Video Auto Infinite Replay (With Help of IA DuckduckGo)- Revert previous version
// @icon            https://external-content.duckduckgo.com/ip3/fr.xhamster.com.ico
//
// @namespace       https://greasyfork.org/fr/users/7434-janvier56
// @homepage        https://greasyfork.org/fr/users/7434-janvier56

// @match           https://*.xhamster.com/videos/*
// @grant           none
// ==/UserScript==

(function() {
  'use strict';
  var videoPage = document.querySelector('.video-page');
  if (videoPage) {
    var observer = new MutationObserver(function(mutations) {
      var playButton = videoPage.querySelector('.player-container__player.xplayer.xp-progress-bar-full.xplayer-paused.overlay-menu-opened .play.replay');
      if (playButton && playButton.classList.contains('replay')) {
        playButton.click();
        observer.disconnect();
      }
    });
    observer.observe(videoPage, { childList: true, subtree: true });
  }
})();