您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
使用百度搜索时,自动显示最近一年的结果,避免搜到很多年前的结果!
// ==UserScript== // @name 百度最新搜索结果 // @namespace https://www.iicode.top/ // @version 0.1 // @description 使用百度搜索时,自动显示最近一年的结果,避免搜到很多年前的结果! // @author iicode // @include *://www.baidu.com/* // @include *://m.baidu.com/* // @grant none // ==/UserScript== (function() { 'use strict'; //https://www.baidu.com/s?ie=utf-8&wd=%E6%B2%B9%E7%8C%B4%E8%84%9A%E6%9C%AC $.getUrlParam = function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } var bUrl = window.location.href; var keyword = gpc = getUrlParam('wd'); var gpc = getUrlParam('gpc'); if(gpc == null) window.location.href = "https://www.baidu.com/s?ie=utf-8&wd="+keyword+"&gpc=stf%3D1558770283%2C1590392683%7Cstftype%3D1" if(gpc.length <= 10){ alert("未选择最新的查询结果"); } })(); function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var paramName = window.location.search.substr(1).match(reg); if(paramName != null){ return decodeURIComponent(paramName[2]); //decodeURIComponent 处理中文乱码 } return null; }