☰

R34 Thumb LMB Control + Remove Tooltip

LMB opens video in bg tab + Remove Tooltip

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         R34 Thumb LMB Control + Remove Tooltip
// @namespace    http://tampermonkey.net/
// @version      3.1
// @match        https://rule34video.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=rule34video.com
// @grant        GM_openInTab
// @run-at       document-start
// @description LMB opens video in bg tab + Remove Tooltip
// ==/UserScript==

(function () {
  'use strict';

  // 1 = обычное поведение, 2 = отключить ЛКМ, 3 = открыть в фоновой вкладке
  const THUMB_LMB_MODE = 3;

  // Очистка нативных подсказок
  document.addEventListener('mouseover', function (e) {
    const el = e.target?.closest?.('[title]');
    if (el?.closest?.('.thumb, .th, .video-card-meta')) {
      el.removeAttribute('title');
    }
  }, true);

  // Обработка нажатия ЛКМ на миниатюре
  if (THUMB_LMB_MODE !== 1) {
    document.addEventListener('click', function (e) {
      if (e.button !== 0) return;

      const thumb = e.target.closest('.thumb, .th');
      if (!thumb) return;

      const link = thumb.tagName.toLowerCase() === 'a' ? thumb : (thumb.closest('a') || thumb.querySelector('a'));
      if (!link || !link.href) return;

      e.preventDefault();
      e.stopImmediatePropagation();

      if (THUMB_LMB_MODE === 3) {
        GM_openInTab(link.href, {
          active: false,
          insert: true,
          setParent: true
        });
      }
    }, true);
  }
})();