reddit.com - Expand Dropdowns by Hover

Hover on 'sorted by:' and 'links from:' dropdowns to expand them, move the mouse away for close. Avoid one unnecessary click.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name               reddit.com - Expand Dropdowns by Hover
// @namespace          a-pav
// @description        Hover on 'sorted by:' and 'links from:' dropdowns to expand them, move the mouse away for close. Avoid one unnecessary click.
// @match              *://*.reddit.com/*
// @match              *://reddit.com/*
// @version            1.0
// @run-at             document-end
// @author             a-pav
// @grant              none
// @icon               https://www.redditstatic.com/desktop2x/img/favicon/apple-icon-76x76.png
// ==/UserScript==

// operates on old design.
document.querySelectorAll("div.menuarea>div.spacer>div.dropdown.lightdrop")
	.forEach(function(elm) { 
		elm.addEventListener('mouseenter', function(event) {
			// 'open_menu' function is from reddit.com
			open_menu(event.target);
		});

		elm.nextSibling.addEventListener('mouseleave', function(event) {
			this.classList.remove("inuse");
		});
	});