您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在页面底部显示一个聚合搜索引擎切换导航
// ==UserScript== // @name 聚合搜索引擎切换(自用-改图标) // @namespace http://tampermonkey.net/ // @version v1.11 // @description 在页面底部显示一个聚合搜索引擎切换导航 // @author summer // @match *://*/*keyword=* // @match *://*/*query=* // @match *://*/*word=* // @match *://*/*text=* // @match *://*/*key=* // @match *://*/*web=* // @match *://*/*wd=* // @match *://*/*kw=* // @match *://*/*q=* // @match *://*/*p=* // @grant unsafeWindow // @run-at document-body // @license MIT // ==/UserScript== const punkDeafultMark = "Google-YandexSearch-DS-MetaSo-Kimi-Bing-Baidu"; const searchUrlMap = [ { name: "谷歌", searchUrl: "https://www.google.com/search?q=", searchkeyName: ["q"], matchUrl: /google\.com.*?search.*?q=/g, mark: "Google", svgCode: `<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 100 100"> <path fill="#de333b" d="M43.404,26.257c4.504,0,4.512-7,0-7C38.899,19.257,38.892,26.257,43.404,26.257L43.404,26.257z"></path><path fill="#de333b" d="M66.654,29.757c3.217,0,3.223-5,0-5C63.436,24.757,63.431,29.757,66.654,29.757L66.654,29.757z"></path><path fill="#de333b" d="M23.716,33.132c3.217,0,3.223-5,0-5C20.499,28.132,20.494,33.132,23.716,33.132L23.716,33.132z"></path><path fill="#de333b" d="M75.495,20.948c-0.241-0.874-0.906-1.467-1.746-1.746c-0.166-0.055-0.336-0.097-0.505-0.144 c-0.169-0.16-0.354-0.314-0.569-0.453c-12.147-7.855-26.704-7.673-38.24-0.891c-0.62-0.169-1.302-0.108-1.907,0.23 c-4.651,2.592-7.801,6.963-10.792,11.233c-0.076,0.108-0.13,0.228-0.181,0.348c-0.118,0.158-0.224,0.324-0.3,0.505 c-0.463,1.097-0.086,2.146,0.74,2.887c0.101,0.155,0.216,0.302,0.363,0.426c1.501,1.264,3.068,2.456,4.71,3.53 c0.944,0.618,1.967,1.374,3.14,1.402c1.368,0.032,2.359-0.7,3.135-1.754c0.224-0.305,0.433-0.621,0.653-0.929 c0.044-0.061,0.089-0.122,0.133-0.183c7.929-7.653,19.208-10.044,29.547-5.537c0.221,0.096,0.44,0.16,0.656,0.213 c1.017,0.911,2.505,0.936,3.509-0.021c2.337-2.228,4.673-4.455,7.01-6.683C75.493,22.77,75.727,21.792,75.495,20.948z"></path><path fill="#f2b71f" d="M23.341,44.382c3.217,0,3.223-5,0-5C20.124,39.382,20.119,44.382,23.341,44.382L23.341,44.382z"></path><path fill="#f2b71f" d="M17.896,53.393c-0.701,1.999-0.379,4.128-0.064,6.163c1.607-0.443,3.214-0.886,4.821-1.329 c-0.23-1.167-0.46-2.334-0.69-3.502c-0.111-0.564-0.647-1.229-1.149-1.494c-0.505-0.267-1.026-0.373-1.594-0.297 c-1.219,0.164-2.163,1.202-2.168,2.455c-0.008,2.21,0.537,4.339,1.512,6.313c0.267,0.539,0.93,0.994,1.494,1.149 c0.598,0.165,1.395,0.09,1.926-0.252c0.534-0.344,1.004-0.857,1.149-1.494c0.155-0.682,0.059-1.298-0.252-1.926 c-0.103-0.209-0.2-0.42-0.292-0.633c0.084,0.199,0.168,0.398,0.252,0.597c-0.39-0.934-0.653-1.907-0.788-2.91 c0.03,0.222,0.06,0.443,0.089,0.665c-0.062-0.501-0.093-1.003-0.091-1.508c-1.637,0.222-3.274,0.443-4.911,0.665 c0.23,1.167,0.46,2.334,0.69,3.502c0.116,0.589,0.646,1.2,1.149,1.494c0.536,0.314,1.326,0.446,1.926,0.252 c0.605-0.196,1.189-0.571,1.494-1.149c0.084-0.199,0.168-0.398,0.252-0.597c0.119-0.443,0.119-0.886,0-1.329 c-0.048-0.309-0.094-0.618-0.137-0.927c0.03,0.222,0.06,0.443,0.089,0.665c-0.122-0.926-0.192-1.858-0.072-2.788 c-0.03,0.222-0.06,0.443-0.089,0.665c0.057-0.382,0.145-0.753,0.272-1.118c0.206-0.587,0.054-1.403-0.252-1.926 c-0.303-0.519-0.898-1.013-1.494-1.149c-0.64-0.146-1.358-0.114-1.926,0.252C18.476,52.265,18.121,52.752,17.896,53.393 L17.896,53.393z"></path><path fill="#f2b71f" d="M21.091,41.57c3.217,0,3.223-5,0-5C17.874,36.57,17.869,41.57,21.091,41.57L21.091,41.57z"></path><path fill="#74953c" d="M73.654,72.983c-1.921-1.997-3.834-4.073-5.912-5.909c-1.165-1.029-2.508-1.634-4.079-1.165 c-1.246,0.372-2.314,1.301-3.458,1.903c-4.149,2.184-9.08,2.86-13.667,1.918c-0.02-0.004-0.037-0.003-0.056-0.006 c-0.246-0.195-0.544-0.355-0.908-0.457c-5.109-1.425-9.552-4.693-12.386-9.184c-0.3-0.475-0.688-0.79-1.111-0.977 c-0.577-1.2-2.016-1.983-3.46-1.13c-2.124,1.253-4.114,2.709-5.98,4.32c-0.331,0.286-0.538,0.617-0.653,0.965 c-0.226,0.084-0.45,0.198-0.663,0.368c-0.877,0.698-1.409,2.221-0.644,3.225c3.819,5.008,7.833,10.211,13.658,12.989 c0.042,0.02,0.085,0.033,0.128,0.051c5.124,4.238,12.544,5.313,18.997,4.771c6.726-0.565,13.268-2.921,18.649-7.026 c0.201-0.154,0.377-0.33,0.537-0.516C74.409,76.57,74.921,74.3,73.654,72.983z"></path><path fill="#3158a7" d="M57.412,48.632c0.559-0.091,1.118-0.182,1.676-0.272c3.344-0.543,3.34-6.201,0-6.75 c-0.653-0.107-1.306-0.215-1.959-0.322c0,2.25,0,4.5,0,6.75c2.098-0.601,7.868-0.347,11.077-0.356 c2.557-0.007,5.117,0.008,7.673,0.112c1.011,0.041,4.322,0.219,4.289,0.205c4.091,1.774,7.66-4.255,3.533-6.044 c-4.258-1.846-9.901-1.267-14.431-1.273c-4.375-0.006-9.73-0.616-14.001,0.607c-3.089,0.885-3.57,6.163,0,6.75 c0.653,0.107,1.306,0.215,1.959,0.322c0-2.25,0-4.5,0-6.75c-0.559,0.091-1.118,0.182-1.676,0.272 C51.116,42.603,52.998,49.35,57.412,48.632L57.412,48.632z"></path><path fill="#316db0" d="M74.06,68.21c2.574,0,2.578-4,0-4C71.486,64.21,71.482,68.21,74.06,68.21L74.06,68.21z"></path><path fill="#316db0" d="M71.933,69.386c0.225,0.372,0.504,0.725,0.826,1.019c0.322,0.294,0.684,0.557,1.077,0.748 c0.115,0.073,0.239,0.113,0.372,0.119c0.133,0.03,0.266,0.024,0.399-0.018c0.232-0.064,0.483-0.243,0.598-0.46 c0.123-0.232,0.184-0.513,0.101-0.771c-0.077-0.237-0.227-0.485-0.46-0.598c-0.23-0.111-0.446-0.246-0.649-0.401 c0.067,0.052,0.135,0.104,0.202,0.156c-0.247-0.192-0.468-0.414-0.66-0.661c0.052,0.067,0.104,0.135,0.156,0.202 c-0.085-0.111-0.164-0.226-0.236-0.346c-0.131-0.217-0.352-0.392-0.598-0.46c-0.133-0.042-0.266-0.048-0.399-0.018 c-0.133,0.006-0.257,0.046-0.372,0.119c-0.214,0.138-0.401,0.343-0.46,0.598C71.773,68.876,71.792,69.152,71.933,69.386 L71.933,69.386z"></path><path fill="#3158a7" d="M72.153,70.137c0.382,1.18,1.148,2.173,2.234,2.787c0.684,0.386,1.67,0.185,2.052-0.538 c0.418-0.791,0.132-1.544-0.538-2.052c-0.234-0.177,0.008,0.014-0.201-0.158c-0.123-0.102-0.248-0.202-0.37-0.305 c-0.265-0.223-0.523-0.454-0.776-0.691c-0.486-0.456-0.946-0.937-1.386-1.437c-0.707,0.707-1.414,1.414-2.121,2.121 c1.107,1.068,2.215,2.136,3.322,3.204c0.606-0.785,1.212-1.571,1.818-2.356c-0.402-0.177-0.794-0.374-1.172-0.596 c-0.2-0.118-0.397-0.242-0.589-0.372c-0.085-0.058-0.169-0.118-0.254-0.177c-0.045-0.032-0.191-0.14-0.067-0.045 c-0.738-0.565-1.34-1.275-2.013-1.911c-0.698-0.661-1.501-1.183-2.294-1.719c-0.183-0.124-0.364-0.25-0.543-0.379 c-0.113-0.081-0.225-0.164-0.337-0.247c-0.014-0.011-0.203-0.156-0.094-0.071c-0.175-0.137-0.348-0.278-0.519-0.422 c-0.107-0.09-0.212-0.18-0.317-0.272c-0.042-0.036-0.084-0.073-0.125-0.11c-0.148-0.144-0.108-0.054,0.122,0.269 c0,0.266,0,0.532,0,0.798c-0.273,0.401-0.33,0.512-0.169,0.334c0.06-0.063,0.121-0.126,0.181-0.189 c0.121-0.126,0.241-0.252,0.362-0.378c0.241-0.252,0.482-0.504,0.723-0.756c0.543-0.567,0.606-1.565,0-2.121 c-0.588-0.54-1.542-0.606-2.121,0c-0.464,0.484-0.967,0.95-1.397,1.464c-0.695,0.83-0.659,1.876,0.116,2.645 c0.957,0.949,2.132,1.704,3.245,2.453c0.521,0.351,0.724,0.504,1.219,0.99c0.438,0.429,0.85,0.885,1.307,1.295 c0.96,0.864,2.04,1.586,3.222,2.108c0.693,0.306,1.444,0.249,1.935-0.386c0.446-0.577,0.424-1.447-0.117-1.97 c-1.107-1.068-2.215-2.136-3.322-3.204c-0.565-0.545-1.567-0.604-2.121,0c-0.579,0.631-0.554,1.49,0,2.121 c1.004,1.144,2.128,2.141,3.34,3.06c0.505-0.863,1.009-1.727,1.514-2.59c-0.06-0.034-0.477-0.341-0.24-0.136 c-0.134-0.115-0.256-0.239-0.373-0.372c0.208,0.238-0.103-0.185-0.139-0.238c-0.075-0.156-0.081-0.156-0.017,0.001 c-0.032-0.082-0.061-0.165-0.087-0.249c-0.242-0.745-1.05-1.305-1.845-1.048C72.455,68.532,71.893,69.337,72.153,70.137 L72.153,70.137z"></path><path fill="#3158a7" d="M87.207,48.132c0.047-0.646,0.009-1.243-0.136-1.795c-0.003-0.023-0.002-0.046-0.005-0.069 c-0.024-0.197-0.067-0.387-0.12-0.573c0.753-2.145-0.533-5.093-3.173-4.811c-5.775,0.617-11.56,0.866-17.366,0.608 c-2.922-0.13-6.102-0.624-8.878,0.223c-0.094-0.045-0.185-0.091-0.287-0.133c-0.342-0.142-0.71-0.236-1.084-0.297 c-0.043-0.022-0.086-0.044-0.129-0.065c-1.073-0.53-2.183-0.705-3.294-0.145c-1.156,0.583-1.532,1.848-1.46,3.05 c0.169,2.833,0.339,5.666,0.508,8.498c0.078,1.303,1.094,2.563,2.5,2.5c0.159-0.007,0.309-0.031,0.455-0.06 c0.445,0.203,0.969,0.327,1.586,0.329c4.938,0.018,9.876,0.036,14.813,0.054c-0.883,2.027-1.909,3.987-3.053,5.882 c0,0,0,0.001,0,0.001c-0.367,0.405-0.731,0.807-1.076,1.21c-0.717,0.839-1.165,1.796-0.988,2.922 c0.18,1.148,0.961,1.811,1.812,2.509c0.821,0.672,1.641,1.345,2.462,2.017c0.073,0.411,0.324,0.781,0.706,1.071 c0.052,0.04,0.076,0.057,0.09,0.068c0.014,0.011,0.03,0.024,0.057,0.046c0.129,0.104,0.259,0.207,0.387,0.313 c0.22,0.181,0.436,0.365,0.65,0.553c0.445,0.392,0.876,0.799,1.292,1.22c0.483,0.489,0.937,1.029,1.62,1.242 c0.842,0.263,1.679-0.034,2.3-0.625c0.135-0.129,0.25-0.285,0.371-0.433c0.066-0.036,0.132-0.067,0.199-0.109 c1.516-0.947,2.547-3.153,3.395-4.677c0.987-1.774,1.836-3.634,2.564-5.539C86.325,58.526,87.479,53.308,87.207,48.132z"></path><path fill="#f2b71f" d="M31.697,39.584c0.385-1.173-0.654-1.914-1.613-1.825c-1.605-0.966-3.209-1.931-4.814-2.897 c-0.684-0.411-1.36-0.826-2.021-1.272c-0.008-0.005-0.009-0.005-0.015-0.009c-0.014-0.012-0.022-0.02-0.042-0.037 c-0.065-0.056-0.131-0.112-0.195-0.17c-0.126-0.115-0.242-0.238-0.359-0.362c-0.025-0.027-0.023-0.026-0.034-0.039 c-0.048-0.07-0.096-0.14-0.14-0.213c-0.039-0.066-0.071-0.135-0.108-0.201c-0.006-0.02-0.012-0.04-0.023-0.073 c-0.247-0.743-1.046-1.306-1.845-1.048c-0.579,0.188-1.049,0.724-1.102,1.33c-3.149,3.908-3.842,9.741-3.923,14.582 c-0.093,5.534,1.066,10.976,3.262,16.045c0.125,0.289,0.302,0.483,0.503,0.609c0.089,0.123,0.175,0.246,0.284,0.369 c0.408,0.461,1.302,0.596,1.818,0.235c2.189-1.533,4.378-3.066,6.567-4.599c0.9-0.63,2.113-1.237,2.802-2.116 c0.772-0.985,0.477-2.055,0.22-3.169c-0.05-0.216-0.081-0.435-0.126-0.652c0.011-0.12,0.023-0.239,0.009-0.365 c-0.372-3.369-0.394-6.757-0.108-10.13C30.937,42.228,31.268,40.893,31.697,39.584z"></path><path fill="#74953c" d="M73.084,76.461c-0.049-0.004-0.099-0.009-0.148-0.013c-0.179-0.179-0.359-0.359-0.538-0.538 c0.042,0.06,0.083,0.121,0.125,0.181c0.078-0.606,0.156-1.212,0.235-1.818c-4.307,3.551-9.947,4.892-15.264,6.12 c-1.88,0.434-1.084,3.327,0.798,2.893c5.888-1.36,11.836-2.974,16.587-6.892c0.476-0.393,0.583-1.312,0.235-1.818 c-0.495-0.718-1.136-1.14-2.029-1.116C71.157,73.512,71.149,76.512,73.084,76.461L73.084,76.461z"></path><path fill="#de333b" d="M34.671,20.845c1.054-0.631,2.13-1.219,3.23-1.766c1.529-0.76,0.46-3.223-1.156-2.742 c-1.374,0.41-2.705,0.929-4.006,1.532c0.505,0.863,1.009,1.727,1.514,2.59c5.339-2.805,11.196-4.972,17.319-4.318 c0.807,0.086,1.5-0.751,1.5-1.5c0-0.883-0.691-1.413-1.5-1.5c-6.624-0.708-13.063,1.696-18.833,4.727 c-1.731,0.909-0.211,3.391,1.514,2.59c1.066-0.494,2.163-0.894,3.29-1.23c-0.385-0.914-0.771-1.828-1.156-2.742 c-1.1,0.547-2.176,1.135-3.23,1.766C31.502,19.245,33.009,21.84,34.671,20.845L34.671,20.845z"></path><path fill="#de333b" d="M22.176,32.967c0.438,0.033,0.765,0.245,1.106,0.508c0.385-0.914,0.771-1.828,1.156-2.742 c-0.252-0.05-0.508-0.099-0.747-0.198c-0.09-0.034-0.177-0.077-0.259-0.129c-0.272-0.183-0.278-0.164-0.018,0.056 c0.068,0.252,0.137,0.505,0.205,0.757c-0.089,0.092-0.094,0.079-0.016-0.041c0.053-0.101,0.106-0.202,0.16-0.303 c0.09-0.168,0.183-0.334,0.277-0.5c0.207-0.364,0.422-0.723,0.646-1.077c0.413-0.653,0.852-1.292,1.326-1.903 c0.986-1.271,2.108-2.445,3.309-3.514c2.362-2.102,5.141-3.765,8.114-4.842c0.761-0.276,1.274-1.02,1.048-1.845 c-0.202-0.735-1.08-1.325-1.845-1.048c-4.084,1.479-7.806,3.841-10.842,6.954c-1.494,1.532-2.828,3.244-3.941,5.071 c-0.604,0.992-1.517,2.226-1.182,3.445c0.331,1.2,1.878,1.793,2.968,2.008c1.745,0.344,2.485-1.717,1.156-2.742 c-0.768-0.592-1.665-0.847-2.62-0.918c-0.809-0.06-1.5,0.733-1.5,1.5C20.676,32.329,21.365,32.906,22.176,32.967L22.176,32.967z"></path><path fill="none" d="M53.474,42.619c-1.154-0.005-2.463,0.056-3.217,0.929c-0.672,0.778-0.651,1.918-0.594,2.944 c0.143,2.557,0.285,5.115,0.428,7.672c0.043,0.772,0.109,1.604,0.612,2.191c0.647,0.757,1.769,0.837,2.764,0.86 c5.264,0.123,10.528,0.245,15.792,0.368c0.468,0.011-3.355,6.658-6.145,9.34c-2.902,2.791-6.83,4.522-10.834,5.065 c-7.767,1.054-15.986-2.755-20.203-9.361c-2.147-3.364-3.285-7.323-3.536-11.306c-0.235-3.734,0.321-7.594,2.143-10.862 c1.718-3.083,4.481-5.493,7.551-7.235c7-3.973,15.83-4.551,23.289-1.523c1.246,0.506,2.603,1.117,3.883,0.705 c0.778-0.25,1.389-0.843,1.969-1.418c1.727-1.709,3.455-3.417,5.182-5.126c0.692-0.685,1.437-1.502,1.366-2.473 c-0.072-0.989-0.96-1.696-1.79-2.239c-23.74-15.527-58.12-1.207-58.116,29.631c0.002,12.896,7.656,25.487,19.046,31.534 c11.391,6.047,26.081,5.293,36.791-1.89c9.879-6.625,15.984-18.457,15.875-30.324c-0.009-1-0.062-1.999-0.161-2.996"></path><path d="M53.474,42.619c0,0-0.311-0.018-0.919,0.004c-0.303,0.017-0.684,0.043-1.124,0.162c-0.434,0.115-0.948,0.352-1.329,0.841 c-0.385,0.487-0.549,1.186-0.575,1.923c-0.024,0.744,0.036,1.538,0.059,2.404c0.065,1.732,0.14,3.729,0.224,5.975 c0.025,0.557,0.022,1.16,0.213,1.791c0.17,0.634,0.699,1.252,1.359,1.502c0.65,0.274,1.337,0.321,1.999,0.353 c0.655,0.026,1.324,0.053,2.008,0.081c2.737,0.108,5.708,0.225,8.899,0.351c1.297,0.055,2.638,0.111,4.022,0.17 c0.027,0.255-0.182,0.516-0.289,0.756c-0.132,0.244-0.271,0.481-0.412,0.713c-0.215,0.347-0.432,0.696-0.65,1.049 c-0.242,0.368-0.485,0.739-0.73,1.112c-1.003,1.47-2.097,2.974-3.366,4.274c-1.289,1.267-2.856,2.359-4.586,3.19 c-3.467,1.673-7.621,2.36-11.735,1.618c-4.094-0.756-8.194-2.786-11.236-6.061c-3.075-3.22-4.909-7.727-5.362-12.489 c-0.474-4.742,0.382-9.878,3.641-13.533c1.598-1.844,3.645-3.387,5.923-4.563c2.263-1.205,4.759-2.026,7.342-2.494 c2.587-0.436,5.272-0.53,7.921-0.161c1.327,0.163,2.641,0.456,3.927,0.843c1.348,0.359,2.37,0.914,4.071,1.472 c0.831,0.245,1.932,0.427,3.073,0.083c1.153-0.356,1.897-1.067,2.461-1.599c1.045-1.026,2.094-2.056,3.147-3.091l1.577-1.55 l0.798-0.785c0.286-0.287,0.598-0.609,0.901-1.019c0.299-0.406,0.609-0.917,0.776-1.584c0.174-0.664,0.125-1.455-0.134-2.106 c-0.555-1.306-1.443-1.893-2.13-2.39C68,16.418,61.94,14.14,55.564,13.402c-12.739-1.489-25.739,3.312-33.844,12.393 c-4.035,4.521-6.859,9.981-8.146,15.647c-1.311,5.645-1.371,11.44-0.172,16.864c2.501,10.824,9.556,19.669,18.08,24.444 c1.047,0.635,2.168,1.108,3.249,1.63c1.122,0.425,2.211,0.912,3.346,1.225c2.235,0.742,4.512,1.164,6.745,1.455 c4.482,0.514,8.85,0.264,12.859-0.665c4.01-0.908,7.691-2.382,10.839-4.327c3.162-1.924,5.802-4.247,7.953-6.669 c4.316-4.874,6.63-10.086,7.908-14.408c1.221-4.371,1.447-7.91,1.407-10.276c0.007-1.186-0.128-2.087-0.152-2.693 c-0.045-0.605-0.068-0.915-0.068-0.915s0.01,0.311,0.03,0.918c-0.001,0.607,0.097,1.508,0.043,2.689 c-0.052,2.356-0.414,5.859-1.77,10.121c-1.41,4.215-3.86,9.242-8.196,13.837c-2.16,2.285-4.774,4.445-7.859,6.201 c-3.072,1.778-6.637,3.088-10.488,3.854c-3.85,0.787-8.016,0.914-12.245,0.327c-2.107-0.327-4.246-0.774-6.329-1.52 c-1.061-0.316-2.069-0.8-3.111-1.217c-0.999-0.513-2.036-0.972-3-1.588c-7.855-4.611-14.284-13.027-16.432-23.038 c-0.508-2.502-0.746-5.07-0.673-7.68c0.018-2.627,0.436-5.254,1.042-7.842c1.24-5.182,3.859-10.099,7.556-14.184 c7.421-8.194,19.358-12.565,31.035-11.196c5.83,0.67,11.412,2.768,16.174,5.864c0.529,0.336,0.875,0.727,0.889,0.822 c0.01,0.045,0.015,0.028,0.005,0.085c-0.011,0.056-0.073,0.205-0.214,0.394c-0.136,0.188-0.335,0.406-0.571,0.643l-0.778,0.775 l-1.568,1.56c-1.039,1.034-2.074,2.064-3.105,3.09c-0.475,0.474-0.865,0.759-1.12,0.826c-0.262,0.086-0.663,0.077-1.21-0.08 c-1.055-0.32-2.629-1.064-4.062-1.431c-1.461-0.425-2.947-0.739-4.441-0.91c-2.984-0.383-5.987-0.247-8.877,0.277 c-2.886,0.556-5.67,1.512-8.2,2.901c-2.535,1.356-4.851,3.134-6.706,5.339c-1.869,2.195-3.136,4.898-3.712,7.605 c-0.597,2.717-0.645,5.449-0.34,8.069c0.592,5.235,2.727,10.249,6.285,13.825c3.498,3.597,8.059,5.717,12.589,6.443 c4.569,0.709,9.109-0.169,12.825-2.089c1.868-0.962,3.536-2.186,4.936-3.641c1.364-1.481,2.421-3.042,3.416-4.589 c0.241-0.391,0.48-0.779,0.717-1.164c0.239-0.414,0.477-0.826,0.712-1.234c0.576-1.064,1.188-2.143,0.963-2.915 c-0.446-0.094-0.89-0.188-1.329-0.281c-0.565-0.008-1.125-0.016-1.681-0.024c-0.833-0.007-1.652-0.013-2.458-0.019 c-3.193-0.023-6.167-0.044-8.906-0.064c-0.684-0.005-1.353-0.009-2.007-0.013c-0.64-0.006-1.256-0.04-1.77-0.239 c-0.519-0.189-0.874-0.573-1.044-1.079c-0.175-0.505-0.203-1.074-0.245-1.635c-0.166-2.242-0.314-4.234-0.442-5.963 c-0.106-1.704-0.394-3.25,0.319-4.222c0.336-0.469,0.815-0.718,1.235-0.848c0.424-0.134,0.802-0.176,1.102-0.205 C53.162,42.614,53.474,42.619,53.474,42.619z"></path><path fill="#316db0" d="M83.174,46.83c-0.088-1.141-0.691-2.136-1.764-2.589c-0.907-0.383-1.87-0.29-2.669,0.222 c-0.222-0.072-0.458-0.126-0.724-0.139c-6.376-0.296-12.76-0.388-19.142-0.277c-3.214,0.056-3.224,5.056,0,5 c0.203-0.004,0.407-0.003,0.611-0.006c0.202,0.06,0.41,0.108,0.627,0.128c5.468,0.521,10.952,0.837,16.443,0.973 c-0.288,1.053-0.629,2.092-1.024,3.112c-0.211,0.546-0.058,1.445,0.252,1.926c0.299,0.464,0.684,0.807,1.195,1.023 c0.117,0.049,0.237,0.083,0.357,0.114c0.131,0.088,0.271,0.166,0.419,0.229c1.088,0.459,2.55,0.089,3.122-1.023 c0.894-1.737,1.467-3.644,1.633-5.589c0.016-0.057,0.032-0.114,0.047-0.171C82.811,48.843,83.248,47.792,83.174,46.83z"></path> </svg> `}, { name: "必应", searchUrl: "https://www.bing.com/search?q=", searchkeyName: ["q"], matchUrl: /bing\.com.*?search\?q=?/g, mark: "Bing", svgCode: `<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 48 48"> <linearGradient id="ZkmZ8eVihrQTUnr9TZpNla_pOADWgX6vV63_gr1" x1="11.905" x2="17.941" y1="1.952" y2="40.401" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#3dbffc"></stop><stop offset="1" stop-color="#183efb"></stop></linearGradient><path fill="url(#ZkmZ8eVihrQTUnr9TZpNla_pOADWgX6vV63_gr1)" d="M17.572,37.076L20,35.619V10.603c0-1.632-0.796-3.161-2.133-4.096L12.36,2.652 C11.366,1.956,10,2.667,10,3.881V32.5c0,0.22,0.02,0.555,0.033,0.772C10.369,36.867,14.382,38.99,17.572,37.076z"></path><linearGradient id="ZkmZ8eVihrQTUnr9TZpNlb_pOADWgX6vV63_gr2" x1="14.342" x2="34.121" y1="41.478" y2="25.575" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#33bef0"></stop><stop offset=".159" stop-color="#32b9f0"></stop><stop offset=".341" stop-color="#2facf2"></stop><stop offset=".533" stop-color="#2a95f4"></stop><stop offset=".733" stop-color="#2475f6"></stop><stop offset=".936" stop-color="#1b4cfa"></stop><stop offset="1" stop-color="#183efb"></stop></linearGradient><path fill="url(#ZkmZ8eVihrQTUnr9TZpNlb_pOADWgX6vV63_gr2)" d="M32.682,27.904L20,35.5v0l-2.428,1.457c-3.191,1.915-7.203-0.209-7.54-3.804 C10.372,38.922,15.145,43.5,21,43.5c1.963,0,3.888-0.536,5.568-1.551l6.834-4.126c0.817-0.493,1.522-1.075,2.15-1.707 C37.906,33.415,36.739,28.669,32.682,27.904z"></path><linearGradient id="ZkmZ8eVihrQTUnr9TZpNlc_pOADWgX6vV63_gr3" x1="24.223" x2="45.699" y1="17.113" y2="38.588" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#3dbffd"></stop><stop offset="1" stop-color="#1de9b6"></stop></linearGradient><path fill="url(#ZkmZ8eVihrQTUnr9TZpNlc_pOADWgX6vV63_gr3)" d="M33.636,19.568l-7.607-3.803c-1.234-0.617-2.576,0.618-2.064,1.899l1.755,5.886 c0.499,1.248,1.479,2.242,2.719,2.758L32.5,28c4.057,0.766,5.352,5.251,3.052,8.117C40.399,31.24,40.088,22.794,33.636,19.568z"></path> </svg> ` }, { name: "百度", searchUrl: "https://www.baidu.com/s?wd=", searchkeyName: ["wd", "word"], matchUrl: /baidu\.com.*?w(or)?d=?/g, mark: "Baidu", svgCode: `<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 48 48"> <path fill="#1565c0" d="M36.094 31.35c-1.695-1.5-3.754-3.225-6.66-7.35-1.865-2.647-3.512-4-5.934-4-2.664 0-4.117 1.25-5.552 3.279-2.1 2.971-2.925 3.971-5.088 5.675-.786.619-4.861 3.172-4.86 7.671C8.001 41.875 11.753 44 15.155 44c4.469 0 5.439-1 8.345-1 3.633 0 5.57 1 8.476 1C37.789 44 39 39.625 39 36.872 39 34.25 37.789 32.85 36.094 31.35zM11.389 24.885c3.124-.694 3.616-3.739 3.611-5.732-.002-.696-.064-1.263-.096-1.558-.198-1.678-2.027-4.55-4.551-4.594-.12-.002-.242.002-.365.013-3.412.314-3.911 5.412-3.911 5.412-.056.287-.082.613-.078.963.031 2.263 1.356 5.527 4.274 5.61C10.623 25.008 10.994 24.973 11.389 24.885M19.503 16C21.99 16 24 13.315 24 9.998 24 6.681 21.99 4 19.503 4 17.015 4 15 6.681 15 9.998 15 13.315 17.015 16 19.503 16M29.522 16.964c.221.031.436.041.645.033 2.696-.103 4.416-3.276 4.781-5.723.037-.241.054-.486.052-.733-.015-2.441-1.831-5.012-3.799-5.49-2.177-.532-4.893 3.173-5.138 5.59-.037.37-.059.739-.063 1.103C25.975 14.296 26.841 16.599 29.522 16.964M41.984 21.142c0-1.281-1.004-5.142-4.742-5.142C33.496 16 33 19.644 33 22.219c0 2.41.187 5.752 4.578 5.781.087.001.176 0 .267-.002 4.027-.094 4.183-4.203 4.152-6.138C41.993 21.561 41.984 21.315 41.984 21.142"></path><path fill="#fff" d="M24 31v7.5c0 0 0 1.875 2.625 2.5H33V31h-2.625v7.5h-2.75c0 0-.875-.125-1-.75V31H24zM20 27v4h-3c-2.125.375-4 2.25-3.999 4.875C13.001 35.917 13 35.958 13 36c0 2.75 1.875 4.625 4 5h5.625V27H20zM20 38.75h-2.375c-.75 0-2-1.125-2-2.75s1.25-2.75 2-2.75H20V38.75z"></path> </svg> ` }, { name: "秘塔", searchUrl: "https://metaso.cn/?s=itab1&q=", searchkeyName: ["q"], matchUrl: /metaso\.cn.*?q=/g, mark: "MetaSo", svgCode: `<svg xmlns="http://www.w3.org/2000/svg"><text x="50%" y="50%" font-size="14" fill="#0000ff" font-family="system-ui, sans-serif" text-anchor="middle" dominant-baseline="middle">秘</text></svg> ` }, { name: "Yandex", searchUrl: "https://yandex.com/search/?text=", searchkeyName: ["text"], matchUrl: /yandex\.com.*?text=/g, mark: "YandexSearch", svgCode: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 40"> <text x="50%" y="50%" font-size="24" fill="#FF0000" font-family="Arial, sans-serif" text-anchor="middle" dominant-baseline="middle">Yandex</text></svg> ` }, { name: "ds", searchUrl: "https://chat.baidu.com/search?word=", searchkeyName: ["word"], matchUrl: /baidu\.com.*?w(or)?d=?/g, mark: "DS", svgCode: `<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 48 48"> <path fill="#536dfe" d="M47.496,10.074c-0.508-0.249-0.727,0.226-1.025,0.467c-0.102,0.078-0.188,0.179-0.274,0.272 c-0.743,0.794-1.611,1.315-2.746,1.253c-1.658-0.093-3.074,0.428-4.326,1.696c-0.266-1.564-1.15-2.498-2.495-3.097 c-0.704-0.311-1.416-0.623-1.909-1.3c-0.344-0.482-0.438-1.019-0.61-1.548c-0.11-0.319-0.219-0.646-0.587-0.7 c-0.399-0.062-0.555,0.272-0.712,0.553c-0.626,1.144-0.868,2.405-0.845,3.681c0.055,2.871,1.267,5.159,3.676,6.785 c0.274,0.187,0.344,0.373,0.258,0.646c-0.164,0.56-0.36,1.105-0.532,1.665c-0.11,0.358-0.274,0.436-0.657,0.28 c-1.322-0.552-2.464-1.369-3.473-2.358c-1.713-1.657-3.262-3.486-5.194-4.918c-0.454-0.335-0.907-0.646-1.377-0.942 c-1.971-1.914,0.258-3.486,0.774-3.673c0.54-0.195,0.188-0.864-1.557-0.856c-1.744,0.008-3.34,0.591-5.374,1.369 c-0.297,0.117-0.61,0.202-0.931,0.272c-1.846-0.35-3.763-0.428-5.765-0.202c-3.77,0.42-6.782,2.202-8.996,5.245 c-2.66,3.657-3.285,7.812-2.519,12.147c0.806,4.568,3.137,8.349,6.719,11.306c3.716,3.066,7.994,4.568,12.876,4.28 c2.965-0.171,6.266-0.568,9.989-3.719c0.939,0.467,1.924,0.654,3.559,0.794c1.259,0.117,2.472-0.062,3.411-0.257 c1.471-0.311,1.369-1.673,0.837-1.922C34,36,33.471,35.441,33.471,35.441c2.19-2.591,5.491-5.284,6.782-14.007 c0.102-0.692,0.016-1.128,0-1.689c-0.008-0.342,0.07-0.475,0.462-0.514c1.079-0.125,2.128-0.42,3.09-0.949 c2.793-1.525,3.919-4.031,4.185-7.034C48.028,10.79,47.981,10.315,47.496,10.074z M23.161,37.107 c-4.177-3.284-6.203-4.365-7.04-4.319c-0.782,0.047-0.641,0.942-0.469,1.525c0.18,0.576,0.415,0.973,0.743,1.478 c0.227,0.335,0.383,0.833-0.227,1.206c-1.345,0.833-3.684-0.28-3.794-0.335c-2.722-1.603-4.998-3.72-6.602-6.614 c-1.549-2.786-2.448-5.774-2.597-8.964c-0.039-0.77,0.188-1.043,0.954-1.183c1.009-0.187,2.049-0.226,3.059-0.078 c4.263,0.623,7.893,2.529,10.936,5.548c1.737,1.72,3.051,3.774,4.404,5.782c1.439,2.132,2.988,4.163,4.959,5.828 c0.696,0.584,1.252,1.027,1.783,1.354C27.667,38.515,24.991,38.554,23.161,37.107L23.161,37.107z M25.164,24.228 c0-0.342,0.274-0.615,0.618-0.615c0.078,0,0.149,0.015,0.211,0.039c0.086,0.031,0.164,0.078,0.227,0.148 c0.11,0.109,0.172,0.265,0.172,0.428c0,0.342-0.274,0.615-0.618,0.615S25.164,24.571,25.164,24.228L25.164,24.228z M31.382,27.419 c-0.399,0.163-0.798,0.303-1.181,0.319c-0.595,0.031-1.244-0.21-1.596-0.506c-0.548-0.459-0.939-0.716-1.103-1.517 c-0.07-0.342-0.031-0.872,0.031-1.175c0.141-0.654-0.016-1.074-0.477-1.455c-0.376-0.311-0.853-0.397-1.377-0.397 c-0.196,0-0.375-0.086-0.508-0.156c-0.219-0.109-0.399-0.381-0.227-0.716c0.055-0.109,0.321-0.373,0.383-0.42 c0.712-0.405,1.533-0.272,2.292,0.031c0.704,0.288,1.236,0.817,2.003,1.564c0.782,0.903,0.923,1.152,1.369,1.829 c0.352,0.529,0.673,1.074,0.892,1.696C32.016,26.905,31.844,27.224,31.382,27.419L31.382,27.419z"></path> </svg> ` }, { name: "kimi", searchUrl: "https://kimi.moonshot.cn/_prefill_chat?send_immediately=true&prefill_prompt=%s", searchkeyName: ["prefill_prompt"], matchUrl: /baidu\.com.*?w(or)?d=?/g, mark: "Kimi", svgCode: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100"> <rect width="100" height="100" fill="white"/> <text x="50%" y="50%" font-family="Arial" font-size="80" font-weight="bold" fill="black" text-anchor="middle" dominant-baseline="middle">K</text> </svg>` }, ]; let lastScrollTop = 0; let punkJetBoxVisible = true; let currentInput = ""; let scriptLoaded = false; function isValidScope() { return searchUrlMap.some(item => window.location.href.match(item.matchUrl) != null); } function getKeywords() { try { let keywords = ""; for (let urlItem of searchUrlMap) { if (window.location.href.match(urlItem.matchUrl) != null) { for (let keyItem of urlItem.searchkeyName) { if (window.location.href.indexOf(keyItem) >= 0) { let url = new URL(window.location.href); keywords = url.searchParams.get(keyItem); if (keywords) { localStorage.setItem("last_successful_keywords", keywords); sessionStorage.setItem("last_successful_keywords", keywords); } return keywords; } } } } return sessionStorage.getItem("last_successful_keywords") || localStorage.getItem("last_successful_keywords") || ""; } catch (error) { console.error("获取关键词时出错:", error.message, "当前URL:", window.location.href); return ""; } } function monitorInputFields() { const inputFields = document.querySelectorAll('input[type="text"], textarea'); if (inputFields.length > 0) { inputFields.forEach(input => { input.addEventListener('input', (event) => { currentInput = event.target.value; sessionStorage.setItem("currentInput", currentInput); }); }); } const observer = new MutationObserver(() => { const newInputFields = document.querySelectorAll('input[type="text"], textarea'); newInputFields.forEach(input => { if (!input.dataset.monitored) { input.dataset.monitored = true; input.addEventListener('input', (event) => { currentInput = event.target.value; sessionStorage.setItem("currentInput", currentInput); }); } }); }); observer.observe(document.body, { childList: true, subtree: true }); } function getAllInputValues() { const inputFields = document.querySelectorAll('input[type="text"], textarea'); return Array.from(inputFields).map(input => input.value).join(' ').trim(); } function addSearchBox() { try { const punkJetBox = document.createElement("div"); punkJetBox.className = "engine-container"; punkJetBox.style.display = 'flex'; punkJetBox.style.zIndex = '9999'; const ulList = document.createElement('div'); ulList.className = "engine-display"; let fragment = document.createDocumentFragment(); let showList = localStorage.getItem("punk_setup_search") || punkDeafultMark; showList = showList.split('-'); for (let showListIndex = 0; showListIndex < showList.length; showListIndex++) { for (let index = 0; index < searchUrlMap.length; index++) { let item = searchUrlMap[index]; if (item.mark === showList[showListIndex]) { let button = document.createElement('button'); button.className = "engine-button"; button.style.backgroundImage = `url('data:image/svg+xml;utf8,${encodeURIComponent(item.svgCode)}')`; button.setAttribute("url", item.searchUrl); button.innerHTML = ''; fragment.appendChild(button); button.addEventListener('mouseover', () => { button.style.backgroundColor = 'rgba(241, 241, 241, 1)'; }); button.addEventListener('mouseout', () => { button.style.backgroundColor = 'rgba(240, 240, 244, 1)'; }); // 修改这里,确保获取百度搜索框中的内容 button.addEventListener('click', (event) => { event.preventDefault(); const url = button.getAttribute("url"); // 尝试从百度搜索框获取内容 const baiduInput = document.querySelector('input#kw'); const latestInput = baiduInput ? baiduInput.value : getAllInputValues(); let keywords = latestInput.length > 0 ? latestInput : getKeywords(); console.log("URL:", url); console.log("Keywords:", keywords); if (url && keywords) { window.open(url + encodeURIComponent(keywords), '_blank'); } else { alert('未找到搜索关键词。'); } }); break; } } } ulList.appendChild(fragment); punkJetBox.appendChild(ulList); document.body.appendChild(punkJetBox); } catch (error) { console.error("添加搜索框时出错:", error.message); } } function injectStyle() { try { const cssNode = document.createElement("style"); cssNode.textContent = ` .engine-container { display: flex; position: fixed; top: 0px; //导航栏位置top or bottom left: 2%; width: 96%; height: 34px; overflow: hidden; justify-content: center; align-items: center; z-index: 1000; background-color: rgba(255, 255, 255, 0); margin-top: 1px; } .engine-display { display: flex; overflow-x: auto; white-space: nowrap; height: 100%; gap: 0px; } .engine-button { width: 55.5px; height: 28px; padding: 0; border: 1px solid #f0f0f0; border-radius: 7px; background-color: rgba(255, 255, 255, 1); color: transparent; font-size: 14px; cursor: pointer; margin: 3px 1px; background-size: contain; background-repeat: no-repeat; background-position: center; backdrop-filter: blur(5px); box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1), 0px 0px 0px rgba(255, 255, 255, 0.5), 6px 6px 10px rgba(0, 0, 0, 0.1) inset, -6px -6px 10px rgba(255, 255, 255, 0) inset; transition: border-color 0.3s, box-shadow 0.3s; flex-shrink: 0; } .engine-button:focus { outline: none; border-color: #ffb61e; } .engine-button.selected { border: 1px solid #ffb61e; color: transparent; } `; document.head.appendChild(cssNode); } catch (error) { console.error("注入样式时出错:", error.message); } } function reloadScript() { const punkJetBox = document.getElementById("punkjet-search-box"); if (punkJetBox) { punkJetBox.remove(); } scriptLoaded = false; init(); } setInterval(() => { if (isValidScope() && !scriptLoaded) { init(); } else if (!isValidScope() && scriptLoaded) { reloadScript(); } }, 1000); function init() { try { const punkJetBox = document.getElementById("punkjet-search-box"); if (punkJetBox) { punkJetBox.remove(); } sessionStorage.clear(); localStorage.removeItem("last_successful_keywords"); localStorage.removeItem("punk_setup_search"); if (getKeywords() != null) { if (!scriptLoaded) { if (!localStorage.getItem("punk_setup_search")) { localStorage.setItem("punk_setup_search", punkDeafultMark); } currentInput = sessionStorage.getItem("currentInput") || ""; monitorInputFields(); addSearchBox(); injectStyle(); scriptLoaded = true; } } } catch (error) { console.error("初始化时出错:", error.message); } } document.addEventListener("visibilitychange", () => { if (document.visibilityState === 'visible') { reloadScript(); } }); document.addEventListener("pageshow", (event) => { if (event.persisted) { reloadScript(); } }); document.addEventListener("DOMContentLoaded", () => { if (isValidScope()) { reloadScript(); } });