Xhamster - AUTO Video Infinite LOOP (IA) v.7

Video Auto Infinite Replay (With Help of IA DuckduckGo)

// ==UserScript==
// @name            Xhamster - AUTO Video Infinite LOOP (IA) v.7
// @version         v.7.0
// @description	    Video Auto Infinite Replay (With Help of IA DuckduckGo)
// @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';

    // Get the video element
    var video = document.querySelector('.video-page .xplayer video');

    // Remove the overlay menu
    var overlayMenu = document.querySelector('html:not(.tablet) .xplayer.overlay-menu-opened .xp-aftershot');
    if (overlayMenu) {
        overlayMenu.remove();
    }

    // Add an event listener to loop the video
    video.addEventListener('ended', function() {
        video.currentTime = 0;
        video.play();
    });
})();