您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a "Site Results" link onto each Google search result entries to search from that site. The link will be added either in the search result entry's popup menu, or after the green URL below the entry's title.
当前为
// ==UserScript== // @name Add Site Search Links To Google Search Result // @namespace https://greasyfork.runtimutd.eu.org/en/users/85671-jcunews // @version 1.0.1 // @description Add a "Site Results" link onto each Google search result entries to search from that site. The link will be added either in the search result entry's popup menu, or after the green URL below the entry's title. // @author jcunews // @include *://www.google.*/search* // @include *://www.google.*.*/search* // @grant none // ==/UserScript== document.querySelectorAll("#ires .g").forEach(function(entry, menu, point) { if (menu = entry.querySelector(".action-menu-item")) { if ((/:\/\/webcache/).test(menu.firstElementChild.href)) { point = menu.nextElementSibling; } else if (menu.firstElementChild.textContent === "Similar") { point = menu; } else point = null; menu = menu.parentNode.insertBefore(menu.cloneNode(true), point).firstElementChild; } else if (menu = entry.querySelector(".f")) { menu.insertAdjacentHTML("beforeend", ' - <a class="fl"></a>'); menu = menu.lastElementChild; } else return; menu.textContent = "Site Results"; entry = entry.querySelector(".r>a"); if (entry.pathname === "/url") { point = unescape(entry.search.match(/&url=([^&]+)/)[1]).match(/:\/\/([^:/]+)/)[1]; } else point = entry.hostname; menu.href = location.href.replace(/([&?]q=[^&]+)/, "$1+site:" + escape(point)); menu.onmousedown = null; });