【让百度搜索聚合找片功能】,从此找片更为方便!
当前为
// ==UserScript==
// @name 百度找片
// @namespace https://gf.qytechs.cn/zh-CN/scripts/26919
// @namespace https://coding.net/u/BackRunner/p/GreaseMonkey-JS/git
// @contributionURL https://sinacloud.net/backrunner/img/alipay.jpg
// @version 1.0
// @description 【让百度搜索聚合找片功能】,从此找片更为方便!
// @author BackRunner
// @include *://www.baidu.com*
// @license MIT
// @grant unsafeWindow
// ==/UserScript==
(function() {
//变量定义
var content = '';
var judge = false;
//主执行区
bindEvent();
process_direct();
function process_direct(){
var search = window.location.search;
var part = search.split('&');
for (var i=0;i<part.length;i++){
if (part[i].indexOf("wd=")!==-1){
content = part[i].replace('wd=','');
}
}
part = content.split('%20');
if (part[part.length - 1]==="%E6%89%BE%E7%89%87"){
content = content.replace('%20%E6%89%BE%E7%89%87','');
//跳转
window.location.href = "http://www.zmz2017.com/search/index?keyword="+content;
}
}
//判断并截取搜索内容
function process_event(){
content = $('#kw').val();
var part = content.split(' ');
console.log(part);
if (part[part.length-1] === '找片'){
judge = true;
content = content.replace(' 找片','');
//跳转
window.location.href = "http://www.zmz2017.com/search/index?keyword="+content;
//reset
judge=false;
}
}
//绑定百度一下按钮和回车
function bindEvent(){
try{
var btn = document.getElementById('su');
btn.addEventListener('click',process_event);
}catch(e){
console.error(e);
}
}
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址