Greasy Fork

Greasy Fork is available in English.

多吉搜索直达按钮

给百度、360、搜狗、必应等搜索引擎的结果页加入多吉搜索按钮,一键跳转到多吉搜索进行相同关键词的检索。

当前为 2019-11-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         多吉搜索直达按钮
// @description  给百度、360、搜狗、必应等搜索引擎的结果页加入多吉搜索按钮,一键跳转到多吉搜索进行相同关键词的检索。
// @namespace    http://greasyfork.icu/zh-CN/users/393603-tsing
// @version      2.1
// @author       Tsing
// @include      *://ipv6.baidu.com/s?*
// @include      *://www.baidu.com/s?*
// @include      *://www.so.com/s?*
// @include      *://www.sogou.com/web?*
// @include      *://cn.bing.com/search?*
// @require      https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// @grant        none
// @note         2019.10.31 V1.0 在百度搜索的结果页加入多吉搜索按钮。
// @note         2019.11.06 V2.0 听取多吉搜索开发者 @nicoljiang 的建议,给检索关键词进行 urlencode 编码,并新增支持360、搜狗、必应搜索。给多吉搜索选择一个特征色号:#dd2248,保证视觉统一性。
// @note         2019.11.16 V2.1 感谢多吉搜索首页(https://dogedoge.com)推广该脚本!本次去除了各搜索引擎结果页面上按钮偶尔出现的下划线,新增了部分颜色动效,和原网站的一致性更高。
// ==/UserScript==

(function() {
    'use strict';

    var hostname = window.location.hostname;

    if(hostname.match(RegExp(/baidu.com/))){
        // 百度搜索
        var url_baidu = "https://www.dogedoge.com/results?q=" + encodeURIComponent($("#kw").val()) + "&from=TsingScript";
        $("#form").append('<span style="display: inline-block;"><a href="' + url_baidu + '" target="_blank" title="利用多吉搜索引擎进行检索" id="dogedoge" style="display:block; float:left; font-size:14px; text-align:center; text-decoration:none; width:100px; height:33px; line-height:33px; margin-left:5px; color:#fff; letter-spacing:1px; background:#3385ff; border-bottom:1px solid #2d78f4; outline:medium;" onmouseover="this.style.background=\'#317ef3\'" onmouseout="this.style.background=\'#3385ff\'">多吉搜索</a></span>')

    }else if(hostname.match(RegExp(/so.com/))){
        // 360搜索
        var url_360 = "https://www.dogedoge.com/results?q=" + encodeURIComponent($("#keyword").val()) + "&from=TsingScript";
        $(".adv-search-wrap").after('<span class="adv-search-wrap"><a href="' + url_360 + '" target="_blank" title="利用多吉搜索引擎进行检索" id="dogedoge" style="display:block; background:#19b955;height:38px;line-height:38px;width:90px;text-align:center; text-decoration:none; color:#ffffff;font-size:14px;" onmouseover="this.style.background=\'#1bc550\'" onmouseout="this.style.background=\'#19b955\'">多吉搜索</a></span>');

    }else if(hostname.match(RegExp(/sogou.com/))){
        //搜狗搜索
        var url_sogou = "https://www.dogedoge.com/results?q=" + encodeURIComponent($("#upquery").val()) + "&from=TsingScript";
        $(".querybox").append('<a href="' + url_sogou + '" target="_blank" title="利用多吉搜索引擎进行检索" id="dogedoge" class="sbtn1" style="text-align:center;text-decoration:none;line-height:34px;color:#333;" onmouseup="this.className=\'sbtn1\'" onmousedown="this.className=\'btnactive\'" onmouseout="this.className=\'sbtn1\'" onmouseover="this.className=\'btnactive\'">多吉搜索</a>');

    }else if(hostname.match(RegExp(/bing.com/))){
        //必应搜索
        var url_bing = "https://www.dogedoge.com/results?q=" + encodeURIComponent($("#sb_form_q").val()) + "&from=TsingScript";
        $("#sb_form").append('<a href="'+ url_bing + '" target="_blank" title="利用多吉搜索引擎进行检索" id="dogedoge" class="b_searchbox" style="display:inline-block; width:100px; line-height:32px; margin:0 0 0 10px; padding:5px; color:#444; font-size:16px; font-weight:500; text-align:center;text-decoration:none; border-radius:6px; border-color:#eee; box-shadow:0 0 0 1px rgba(0,0,0,.1), 0 2px 4px 0 rgba(0,0,0,.16)" onmouseover="this.style.background=\'#f5f5f5\'" onmouseout="this.style.background=\'#ffffff\'">多吉搜索</a>');
    }

})();