Google Search restore URLs (undo breadcrumbs)

Brings back the full URLs in results.

当前为 2019-09-04 提交的版本,查看 最新版本

// ==UserScript==
// @name         Google Search restore URLs (undo breadcrumbs)
// @namespace    https://gf.qytechs.cn/en/users/27283-mutationobserver
// @version      2019.09.04v1
// @description  Brings back the full URLs in results.
// @author       MutationObserver
// @match        https://*.google.com/search?*
// @grant        none
// ==/UserScript==

var results = document.querySelectorAll(".r");

if (results) {
	for (i=0; i < results.length; i++) {
		try {
			var link = results[i].querySelector(".r a").getAttribute("href");
			results[i].querySelector(".r cite").innerHTML = link;
		}
		catch(e){
			continue;
		}
	}

	document.querySelector("body").insertAdjacentHTML("afterbegin", `
		<style id="breadcrumb-removal-userscript">
			.r cite {
				white-space: nowrap;
				text-overflow: ellipsis;
			}
			.r > span {
				position: absolute;
				right: 0;
				top: 5px;
			}
		</style>
	`);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址