您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Re-enables right click on image and video embeds in Discord, since the new custom context menu update.
当前为
- // ==UserScript==
- // @name Discord Embed Right Click Enabler
- // @namespace https://greasyfork.org
- // @version 1.0.1
- // @description Re-enables right click on image and video embeds in Discord, since the new custom context menu update.
- // @author ScocksBox
- // @icon https://i.imgur.com/ZOKp8LH.png
- // @include https://discord.com/*
- // @license MIT
- // @run-at document-end
- // @grant none
- // ==/UserScript==
- /* jshint esversion: 6 */
- var callback = function (mutationsList, observer) {
- let elements = document.querySelectorAll(".message-2CShn3 img:not(.avatar-2e8lTP):not(.replyAvatar-sHd2sU), .message-2CShn3 video");
- for (let i = 0; i < elements.length; i++) {
- let el = elements[i];
- if (!el.classList.contains("contextmenu-fixed")) {
- el.addEventListener('contextmenu', function(event) {
- event.stopImmediatePropagation();
- }, true);
- el.classList.add("contextmenu-fixed");
- }
- }
- };
- const observer = new MutationObserver(callback);
- observer.observe(document.body, { childList: true, subtree: true });