// ==UserScript== // @name cyd油猴脚本测试 // @namespace http://tampermonkey.net/ // @version 0.3 // @description 获取url参数,并且六秒后点击百度搜索框清除按钮,0.3版 // @author XXX // @match *://*/* // @grant GM_log // @require http://code.jquery.com/jquery-3.6.0.min.js /* globals jQuery, $, waitForKeyElements */ // @downloadURL none // ==/UserScript== (function () { 'use strict'; $(document).ready(function () { const paramString = window.location.search.substring(1); // 去掉开头的 '?' const paramArray = paramString.split('&'); const params = {}; for (let i = 0; i < paramArray.length; i++) { const param = paramArray[i].split('='); params[param[0]] = decodeURIComponent(param[1]); } GM_log(params, "version:0.3", $(document)) setTimeout(() => { $(".quickdelete").click(); }, 6666) }); })();