您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Pressing w in google search results will automaticall opne the first Wikipidea link
- // ==UserScript==
- // @name Google search open Wikipedia hotkey
- // @description Pressing w in google search results will automaticall opne the first Wikipidea link
- // @match https://www.google.com/search*
- // @version 1.0.1
- // @license MIT
- // @author gosha305
- // @namespace https://greasyfork.org/en/users/1436613
- // ==/UserScript==
- window.addEventListener('keydown', function(event){
- if (event.target.tagName == 'INPUT' ||
- event.target.tagName == 'SELECT' ||
- event.target.tagName == 'TEXTAREA' ||
- event.target.isContentEditable) {
- return;
- }
- if (event.key != "w" || event.ctrlKey || event.metaKey){
- return;
- }
- Array.from(document.querySelectorAll("#search a")).some((element) => {if (element.getAttribute("href").includes("wikipedia")) {window.location.href = element.getAttribute("href"); return true}});
- })