Loop video files

Sets the loop attribute when viewing video files in their own window/tab.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Loop video files
// @description  Sets the loop attribute when viewing video files in their own window/tab.
// @namespace    var512
// @author       var512
// @version      1.1.0
// @supportURL   https://gitlab.com/var512
// @supportURL   https://github.com/var512
// @include      /\.(m4v|mp4|ogv|webm)$/
// @include      /^data:video\//
// @license      MIT
// @noframes
// @grant        none
// @run-at       document-start
// ==/UserScript==

(() => {
  'use strict';

  const elements = document.getElementsByTagName('video');

  if (typeof elements[0] !== 'undefined') {
    elements[0].setAttribute('loop', 'true');
  }
})();