您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Opens images in new tab on middle click
当前为
// ==UserScript== // @name Imgur open image in new tab // @namespace http://cactuspie.com // @version 1.0 // @description Opens images in new tab on middle click // @author CactusPie // @match https://imgur.com/gallery/* // @grant none // ==/UserScript== (function() { 'use strict'; $(document.body).on("mousedown mouseup click focus blur", "img[src^='//i.imgur.com'],video", e => { let url; if(e.target.tagName.toUpperCase() === "VIDEO") { url = e.target.children[0].src; } else { url = e.target.src; } if(e.which === 2) { const imgName = url.substr(url.lastIndexOf('/') + 1); let imgId = imgName.substr(0, imgName.indexOf(".")); if(imgId.endsWith('g')) { imgId = imgId.substr(0, imgId.length - 1); } window.open(`https://imgur.com/${imgId}`, '_blank'); } }); })();