您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Google 圖片搜尋點擊圖片直接懸浮原圖開啟圖片,而不是進入網站
// ==UserScript== // @name Google 圖片搜尋直開 // @namespace http://tampermonkey.net/ // @version 1.0 // @description Google 圖片搜尋點擊圖片直接懸浮原圖開啟圖片,而不是進入網站 // @author shanlan(ChatGPT o3-mini) // @match https://www.google.com/search* // @grant none // @run-at document-end // @license MIT // ==/UserScript== (function(){ 'use strict'; document.head.appendChild(Object.assign(document.createElement('style'), { textContent: "#tm-image-modal{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.8);display:flex;align-items:center;justify-content:center;z-index:9999}#tm-image-modal img{max-width:90%;max-height:90%;border:2px solid #fff}" })); const getVisibleSrc = a => { for (const img of a.querySelectorAll("img")) { const s = getComputedStyle(img); if (s.visibility !== "hidden" && img.offsetWidth && img.offsetHeight) return img.src; } }, openModal = a => { const m = document.createElement("div"); m.id = "tm-image-modal"; const i = document.createElement("img"); i.src = getVisibleSrc(a); m.appendChild(i); document.body.appendChild(m); const o = new MutationObserver(() => { const n = getVisibleSrc(a); if (n && n !== i.src) i.src = n; }); o.observe(a, {attributes: true, childList: true, subtree: true}); m.onclick = () => { o.disconnect(); m.remove() }; }; document.addEventListener("click", e => { const a = e.target.closest("a.YsLeY"); if (a && getVisibleSrc(a)) { e.preventDefault(); openModal(a) } }); })();