hide twitter video controls (until hover)

6/3/2024, 1:04:59 AM

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        hide twitter video controls (until hover)
// @namespace   Violentmonkey Scripts
// @match       https://x.com/*
// @grant       none
// @version     1.0
// @author      minnieo
// @description 6/3/2024, 1:04:59 AM
// @license     MIT
// ==/UserScript==



document.addEventListener("DOMContentLoaded", () => {
  const videoControls = document.querySelector('div[data-testid="videoComponent"] div.css-175oi2r.r-18u37iz.r-n7gxbd');
  videoControls.style.display = 'none';

  if (videoControls) { // Check if videoControls exists
    // Show controls when the mouse enters the area
    videoControls.addEventListener('mouseenter', () => {
      videoControls.style.display = 'block';
    });

    // Hide controls when the mouse leaves the area
    videoControls.addEventListener('mouseout', () => {
      videoControls.style.display = 'none';
    });
  } else {
    console.error('Video controls element not found.');
  }
});