Add Images Option Back To imgur

Images option added to the Imgur user dropdown menu

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 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         Add Images Option Back To imgur
// @version      0.0.1
// @description  Images option added to the Imgur user dropdown menu
// @author       https://imgur.com/user/Putin/about
// @match        https://*.imgur.com/*
// @namespace https://greasyfork.org/users/1481804
// ==/UserScript==
 
(function() {
    'use strict';
 
    const observer = new MutationObserver((mutations, obs) => {
        const dropdown = document.querySelector('.Dropdown-list .Dropdown-option-group');
        if (dropdown) {
            const usernameElement = document.querySelector('.NavbarUserMenuCover-user');
            if (usernameElement) {
                const username = usernameElement.textContent.trim();
                const imagesOption = document.createElement('a');
                imagesOption.className = 'Dropdown-option';
                imagesOption.href = `https://${username}.imgur.com/all/`;
                imagesOption.textContent = 'Images';
                imagesOption.setAttribute('data-discover', 'true');
                dropdown.insertBefore(imagesOption, dropdown.firstChild);
                obs.disconnect();
            }
        }
    });
 
    observer.observe(document.body, { childList: true, subtree: true });
})();