// ==UserScript== // @name 搜索-plus:为搜索结果页添加其他搜索引擎跳转菜单 // @description 本扩展在原ddrwin 的baidu++扩展基础上修改而来。 // @icon https://www.baidu.com/cache/icon/favicon.ico // @version 1.0 // @author lawchou // @run-at document-start // @include http*://*.baidu.com/* // @include http*://*.so.com/* // @include http*://*.sogou.com/* // @include http*://*.bing.com/* // @include http*://*.fsou.cc/* // @include http*://*.wuzhuiso.com/* // @include *://www.google.com/search?* // @include *://www.google.com.*/search?* // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @resource customCSS https://www.17sucai.com/preview/869565/2018-09-20/css3xynav/css/index.css //@resource 请求CSS资源 // @grant GM_addStyle // @grant GM_getResourceText //配置块里添加上面两个grant var newCSS = GM_getResourceText ("customCSS"); GM_addStyle (newCSS); //代码添加上面两行代码,让油猴解析CSS // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_registerMenuCommand // @note 2022.01.04 V1.0 在百度、搜狗、bing等搜索的结果页加入搜索按钮; // ==/UserScript== (function() { 'use strict'; var add_str ; //搜寻地址元素,class名称前用. id名称前用# var hostname = window.location.hostname; var getkw = function(){ //获取搜索关键词 var kw= $("#kw").val()||$("input[name=q]").val()||$("#upquery").val()||$("#baidu_translate_input").val()||$("#sb_form_q").val()||$("#query").val()|| $("#trans-input").val()||$("#Popover2-toggle").val()||$("input.word").val()||$("input[name=q]").eq(1).val() ||$("#search").val()||$("#searchword").val()|| $("input[name=keyword]").val()||$("input[name=searchInput]").val()||$("#mq").val()||$("#keywords").val()||$("input[name=p]").val()|| $(".right_contents input.selector_input").val()||$("#searchIput").val()||$("input[name=text]").val()||$("input[name=Keywords]").val()||$("#q").val()|| $("#toolbar-search-input").val()||$("input.search-input").val()||$("input[name='facet-search-input']").val()||$(".headword").text()|| $("input[name=ld_search_inp]").eq(1).val()||$("#twotabsearchtextbox").val()||$("#key_S").val()||$("#stickSearchKey").val()||""; return encodeURIComponent(kw.replace(/^\s+|\s+$/gm,'')); }; keywords=getkw(); search_str='
' +'
' +'
' +'web搜索' +'
' +'
' +' google搜索' +'
' +'
' +' 百度搜索' +'
' +'
' +' sogou搜索' +'
' +'
' +' bing搜索' +'
' +'
' +' fsou' +'
' +'
' +' searx.be' +'
' +'
' +' yandex.com' +'
' +'
' +'
' +'
' +'
' +'图片搜索' +'
' +'
' +' google图片' +'
' +'
' +' 百度图片' +'
' +'
' +' sogou图片' +'
' +'
' +' bing图片' +'
' +'
' +' fsou' +'
' +'
' +' searx.be' +'
' +'
' +' yandex.com' +'
' +'
' +'
' +'
' +'
' +'网盘磁力搜索' +'
' //+'
' //+' oxtorrent.com' //+'
' //+'
' //+' torrentkitty.vip' //+'
' //+'
' //+' btdp.online' //+'
' //+'
' //+' uihp.online' //+'
' //+'
' //+' ywxinxi.com' //+'
' +'
' +' 网盘搜索' +'
' //+'
' //+' javdb7.com' //+'
' // +'
' // +' torrentkitty.app' // +'
' +'
' +'
' +'
' +'
' +'软件搜索' +'
' +'
' +' 52pojie.cn' +'
' +'
' +' hrtsea.com' +'
' +'
' +' qiuquan.cc' +'
' +'
' +' macno1.com' +'
' +'
' +' zdfans.com' +'
' +'
' +' dayanzai.me' +'
' +'
' +' appinn.com' +'
' +'
' +' ghpym.com' +'
' +'
' +' yxssp.com' +'
' +'
' + 'iplaysoft.com' + '
' + '
' + '
' + '
' + '
' function add_button(key){ var div = document.querySelector(add_str); //搜寻元素,class名称前用. id名称前用# if (key==1){ div.insertAdjacentHTML('afterend', search_str); //插入内容 ,在当前元素节点的后面 } else if (key==2){ div.insertAdjacentHTML('beforeend', search_str); //插入内容 ,在当前元素节点的前面 } else if (key==3){ div.insertAdjacentHTML('beforebegin', search_str); //插入内容 ,在当前元素内第一个节点的前面 } else if (key==4){ div.insertAdjacentHTML('afterbegin', search_str); //插入内容 ,在当前元素内最后一个节点的后面 } } if(hostname.match(RegExp(/baidu.com/))){ add_str='.s_btn_wr'; //baidu //console.log(add_str); add_button(1); } else if (hostname.match(RegExp(/wuzhuiso.com/))){ add_str='#searchbox' ;//wuzhuiso //console.log(add_str); add_button(1); } else if (hostname.match(RegExp(/so.com/))){ add_str='.adv-search' ;//360so //console.log(add_str); add_button(3); } else if (hostname.match(RegExp(/bing.com/))){ add_str='.b_searchboxForm' ;//bing //console.log(add_str); add_button(1); } else if (hostname.match(RegExp(/sogou.com/))){ add_str='.header-box' ;//sogou //console.log(add_str); add_button(2); } else if (hostname.match(RegExp(/fsou.cc/))){ add_str='#input-with-suggestion' ;//fsou //console.log(add_str); add_button(1); } })();