修改csdn搜索

zh-cn

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
})();