Giter VIP home page Giter VIP logo

Comments (3)

ch3nnn avatar ch3nnn commented on September 18, 2024

修改 "data": [{"name": "百度", "img": "url(https://www.baidu.com/favicon.ico)", "url": "https://www.baidu.com/s?wd="}]

对于搜索 url 可以替换下面

对应的 img url 需要获取搜索引擎的

from webstack-go.

Tingday avatar Tingday commented on September 18, 2024

改了还是不行。而且我看到你代码有想实现保存功能,但是不完整。 var localSearchData = localStorage.getItem("searchData");
if (localSearchData && (searchData.custom === localSearchData.custom)) {
searchData = JSON.parse(localSearchData)
}

from webstack-go.

ch3nnn avatar ch3nnn commented on September 18, 2024

改了还是不行。但是我看到你的代码有想实现保存功能,不完整。 var localSearchData = localStorage.getItem("searchData"); if (localSearchData && (searchData.custom === localSearchData.custom)) { searchData = JSON.parse(localSearchData) }

很抱歉回复这么晚, 大体看了下如果要实现自定义搜索可以修改此处 script userDefinedSearchData 。对于实现客户端cookie保持功能可能暂时无法实现

复制下面代码

<script>
    var userDefinedSearchData = {
        "custom": true,
        "thisSearch": "https://www.google.com/search?q=",
        "thisSearchIcon": "url(https://www.google.com/favicon.ico)",
        "hotStatus": true,
        "data": [
            {"name": "谷歌", "img": "url(https://www.google.com/favicon.ico)", "url": "https://www.google.com/search?q="},
            {"name": "搜狗", "img": "url(https://www.sogou.com/favicon.ico)", "url": "https://www.sogou.com/web?query="},
        ]
    };
</script>

userDefinedSearchData 自定义搜索引擎

  • custom: 是否启用自定义配置
  • thisSearch: 当前搜索引擎的搜索链接
  • thisSearchIcon: 当前搜索引擎的图标链接,格式为url(图片链接)
  • hotStatus: 是否启用搜热词功能
  • data: 多搜索引擎配置

from webstack-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.