您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Press "g" to Google in DuckDuckGo
- // ==UserScript==
- // @name Press "g" to Google (DuckDuckGo)
- // @namespace https://wiki.gslin.org/wiki/Google
- // @version 0.20231006.1
- // @description Press "g" to Google in DuckDuckGo
- // @author Gea-Suan Lin
- // @match https://duckduckgo.com/*
- // @grant GM_addStyle
- // @grant GM_getValue
- // @grant GM_openInTab
- // @grant GM_registerMenuCommand
- // @grant GM_setValue
- // @require https://gf.qytechs.cn/scripts/38445-monkeyconfig/code/MonkeyConfig.js?version=251319
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- const cfg = new MonkeyConfig({
- menuCommand: true,
- params: {
- search_engine: {
- type: 'text',
- default: 'https://www.google.com/search?q=',
- },
- },
- title: 'Press "g" to Google in DuckDuckGo',
- });
- document.addEventListener('keyup', function(event) {
- if (['input', 'textarea'].indexOf(document.activeElement.tagName.toLowerCase()) >= 0) {
- return;
- }
- if ('g' !== event.key) {
- return;
- }
- let q = document.getElementById('search_form_input').value;
- let q_encoded = encodeURIComponent(q).replace(/%20/g, '+');
- let url = cfg.get('search_engine') + q_encoded;
- document.location = url;
- });
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址