你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/382276-%E7%99%BE%E5%BA%A6%E4%B8%8D%E5%88%B0-%E8%B0%B7%E6%AD%8C%E4%B8%80%E4%B8%8B/discussions/319095,源站連結 點此以跳轉

百度不到?谷歌一下!

在百度搜索结果页的搜索按钮下方添加隐藏的谷歌搜索按钮,支持百度新版动态搜索

< 脚本 百度不到?谷歌一下! 的反馈

评价:好评 - 脚本运行良好

§
发布于:2026-01-12

这个脚本应该用了四五年了,脚本很小巧但很实用;

之前的样式有点丑,自己修改了后用的,但是百度最近把样式改成AI风格导致原本的不能用了,今天一看没想到作者还在跟进更新,有点意外;

不过不论是之前的还是现在的,作者的审美都不咋的。。起码搞得好看点嘛。

贴一个我改的,因为我几乎不用duckGo,所以我只改了google的

function createButtons(searchBtn) {
        if (searchBtn.parentNode.querySelector('.my-google-search-btn')) return;

        var input = searchBtn.cloneNode(true);
        input.className = 'my-google-search-btn';
        input.id = 'my-google-search-btn';
        input.textContent = 'Google';
        const computedStyle = window.getComputedStyle(searchBtn);
        input.style.cssText = `
        width: ${computedStyle.width};
        height: ${computedStyle.height};
        line-height: ${computedStyle.lineHeight};
        font-size: ${computedStyle.fontSize};
        font-weight: ${computedStyle.fontWeight};
        color: ${computedStyle.color};
        border: ${computedStyle.border};
        border-radius: ${computedStyle.borderRadius};
        cursor: pointer;
        user-select: none;
        transition: all 0.2s;
        margin-left: 5px;
        `;
        input.style.backgroundImage =
            'radial-gradient(circle at 0% 0%, #EA4335 5%, transparent 60%), ' +
            'radial-gradient(circle at 100% 0%, #4285F4 10%, transparent 60%), ' +
            'radial-gradient(circle at 0% 100%, #FBBC05 15%, transparent 60%), ' +
            'radial-gradient(circle at 100% 100%, #34A853 15%, transparent 60%)';
        input.style.backgroundColor = 'rgb(0 0 0 / 20%)';  // 或 '#f8f9fa' 极浅灰

        input.addEventListener('mouseenter', () => {
        input.style.transform = 'scale(1)';
        input.style.backgroundColor = 'rgb(0 0 0 / 30%)';
        });
        input.addEventListener('mouseleave', () => {
        input.style.transform = 'scale(1)';
        input.style.backgroundColor = 'rgb(0 0 0 / 20%)';
        });

        var input2 = document.createElement('input');
        input2.className = 'my-duck-search-btn';
        input2.style.cssText = config.input2Styles;
        input2.value = 'DuckGo';
        input2.type = 'button';
        input2.style.display = 'none';

        searchBtn.parentNode.addEventListener('mouseenter', function() {
            var kw = document.getElementById('kw');
            var searchText = kw ? kw.value : '';

            if (searchText) {
                input.style.display = 'inline-block';
                input2.style.display = 'inline-block';

                input.onclick = function(e) {
                    e.preventDefault();
                    window.open('https://www.google.com/search?q=' + encodeURIComponent(searchText));
                };

                input2.onclick = function(e) {
                    e.preventDefault();
                    window.open('https://duckduckgo.com/?q=' + encodeURIComponent(searchText));
                };
            }
        });

//         searchBtn.parentNode.addEventListener('mouseleave', function() {
//             input.style.display = 'none';
//             input2.style.display = 'none';
//         });

        searchBtn.parentNode.appendChild(input);
//         searchBtn.parentNode.appendChild(input2);
    }

发布留言

登录以发布留言。