萌娘一下

脚本可以在百度搜索结果页面,“百度一下”按钮的右侧添加一个“萌娘一下”按钮,点击可搜索萌娘百科内容

目前為 2019-07-31 提交的版本,檢視 最新版本

// ==UserScript==
// @name         萌娘一下
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  脚本可以在百度搜索结果页面,“百度一下”按钮的右侧添加一个“萌娘一下”按钮,点击可搜索萌娘百科内容
// @author       You
// @match        *://www.baidu.com/s?*
// @grant        none
// ==/UserScript==




(function() {
    var button = document.createElement('input')
    button.setAttribute('style','background:#a5e4a5;border-bottom:#228b22;')
    button.setAttribute('type','button')
    button.setAttribute('value','萌娘一下')
    button.setAttribute('class','bg s_btn')
    var span = document.createElement('span')
    span.appendChild(button)
    span.setAttribute('style','margin-left:2px;')
    span.setAttribute('class','bg s_btn_wr')
    document.getElementById('form').appendChild(span)
    button.onclick = function(){
        var input = document.getElementById('kw')
        var value = input.value
        window.open('https://zh.moegirl.org/index.php?search='+value)
    }
    delRight()

})();