修改csdn搜索

zh-cn

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         修改csdn搜索
// @namespace    https://blog.csdn.net/
// @version      0.3
// @description  zh-cn
// @author       hh
// @license      MIT
// @match        https://blog.csdn.net/
// @grant        none
// @include      *://*.csdn.net/*
// @connect      www.csdn.net
// @require      https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
(function() {
    'use strict';
    function demo()
        {
        var su = $(".article-comment");
        var txt = window.getSelection();
        if(txt.toString().length>1){
            if(document.getElementsByClassName("article-search")[0]){
            su.remove();
            $(".cnote").remove();
            txt="https://www.baidu.com/s?wd="+txt;
            document.getElementsByClassName("article-search")[0].setAttribute("href",txt);
            clearInterval(demo);
        }else{
            setTimeout(demo,50);
        }
        }
        }
    $('p').mouseup(demo);
})();