GithubHelp home page GithubHelp logo

protonuniverse / bigsearch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garywill/bigsearch

0.0 0.0 0.0 623 KB

Definitly more than a GET/POST sender. Handily use search engines via a Flexible Tool! 大术专搜,既专又广。带些“独门特技”的搜索引擎使用工具 🔎🌐

Home Page: https://garywill.github.io

JavaScript 77.29% CSS 11.14% HTML 11.57%

bigsearch's Introduction

English | 中文

firefox chrome

Big Search

Handily use / switch any one or multiple (uninterruptedly) search engines (or search any websites).

✅ For both daily & work. 🌟 Besides what any multi-engine web search tool can do, it also✨:

  • 🖋️ Single-line or multi-line text
  • 🖥️ Desktop (browser extension / web app) and mobile (web app)
  • 🔎 Even works with websites that don't provide GET/POST interface (so-called Ajax-render websites)
  • 🔎 Do many operations at once by one button
  • 💪 JSON as search engines database (both built-in & user-defined. GUI editing also available). Flexibility & extensibility in engine data & search method

and so on. Go on for details...

signboard

Search everywhere 🗺️ for everything 👨‍💻. Breadth & Focus.

Table of Content

Start to install & use

Ways to use:

  1. Browser extension (recommended)

  2. Web App: For demo purpose. Web app can't function fully like extension. Web app can be used on mobile browsers. Main site: https://acsearch.ga | Standby site: http://acsearch.tk

Basic Features Demo and Screenshots

Use Extension Breadth & Focus UI style choosable
en breadth_chi themes
Context selection search Try web app without install Mobile (testing) (web app)
context web
Edit search engines Special search methods, flexibility & extensibility
edit edit-add

demo_gif

Features

Basic

  • 🔎 Use any search engines or inquery websites (multiple uninterruptedly) from one UI. Any that support GET/POST. (50+ built-in)
  • 🔎 User custom search engine (details) (syncronizable in extension)
  • 🔎 Use browser-installed search engines (browser extension, so can directly use those you've added into browser, Firefox only)

More

  • 🖋️ Single-line or multi-line text input & send

    Useful when e.g. want to translate article

  • 🗂️ Search engines categorization
  • 📋 Save (locally), reuse and manage search history. Reusing method: double-click behavior
    • In single-line edit: replace input box text
    • In multi-line edit: insert to cursor
  • 🖱️ Quickly use selected text (single-line or multi-line) as search term
    • No in Firefox incognito mode (bug 1380812)
    • On Chrome, after clicking context menu item, click the icon on toolbar (or use keyboard shortcut) (defect of Chrome)
  • ⌨️ Keyboard shortcut (browser extension)
    • Open popup. Firefox: Ctrl+Alt+S Chrome & others:Ctrl+Shift+S
    • Set selected text as search term (then use open popup). Firefox: Ctrl+Alt+D Chrome & others:Ctrl+Shift+D

    change on Firefox | change on Chrome: chrome://extensions/shortcuts

  • 🖥️ Desktop (browser extension & web app) and mobile (web app only)

Even more: What's special about it

  • 🔎 Even works with websites that don't provide GET/POST interface (so-called Ajax-render websites) (details)
  • 🔎 Do many operations at once by one button
  • ✨ Good-looking, powerful & lightweight (details)
  • 💪 JSON as search engines database (both built-in & user-defined. GUI edit available). Flexibility & extensibility in engine data & search method: (details)
    • 🔲 Multiple buttons for one engine: more than one operations for one engine. (Buttons inherit data from engine. Some key-value data ​​in button can override the ones in engine name)
    • 📞 Cross-engine use: Call another engine (or it's certain button action) to do the action
    • 🔏 String-formatting or character-replacing user's input, according to engine's need. And, charset specifying.
    • 🔎 Combining above two to search websites that don't provide search

Safety & Privacy

  • 🛡️ Minimum default permissions. Won't ask for sensitive permissions until needed.
  • 🛡️ No injection to web (except when searching Ajax-render websites)
  • 🛡️ Hide HTTP Referrer by default to protect user privacy
  • 🛡️ Client side functions fully. No necessary server. No collecting user's input nor ad analyzing. User can even choose to disable analystics completely

List of engines

50+ , currently. See list of build-in search engines

Similar tools & methods comparison

Comparison of open source web searching (multi-engines) tools

Experienced users may prefer intuitive horizontal comparison to quickly know what's special. (Also know about others btw)

How to edit search engines (GUI or JSON)

Online GUI engine-editing tool (link 1) (link 2)

Following paragraphs of this section are about JSON-format engine data specification. For both:

  1. User-defined private engines
  2. Big Search built-in search engines (enginesdata.js)

Examples

Short Format

You only need to write very simple JSON and have basic HTTP knowledge on GET Method.

{
    "Google": "https://www.google.com/search?q={0}",
    "Yahoo Search": "https://search.yahoo.com/search?q={0}"
}
More about short format

Although above is simple and correct, if you're programmer it's not recommended to use display name as key. We should at least, for example:

{
    "yahoo": {
        "dname": "Yahoo Search",
        "full_url": "https://search.yahoo.com/search?q={0}"
    }
}

Full Format

Using full format you have opportunity to use all the features of this tool.

Also, mixing short formatted and full formatted elements is supported.

Full format examples
{
    "yahoo": {
        "dname": "Yahoo Search",
        "addr": "https://search.yahoo.com",
        "action": "https://search.yahoo.com/search",
        "kw_key": "q"
    },

    "google": {
        "dname": "Google",
        "addr": "https://www.google.com",
        "action": "https://www.google.com/search",
        "kw_key": "q",
        "btns": {
            "search": {
                "label": "Google Search"
            },
            "lucky": {
                "label": "I'm Feeling Lucky",
                "params": [
                    {"key":"btnI", "val": "1"}
                ]
            }
        }
    },

    "label_mbap" : { "lstr": "Cross-engine" },
    "itunesapps": {
        "dname": "iTunes Apps (Google)",
        "addr": "https://www.apple.com/itunes/charts/free-apps/",
        "btns": {
            "search_apps": {
                "label": "Search Apps",
                "kw_format": "{0} site:apple.com/*app",
                "use_other_engine": {
                    "engine": "google",
                    "btn": "search"
                }
            }
        }
    },

    "label_usaj": { "lstr": "Search Ajax-render web" },
    "chrome_ext_dev": {
        "dname": "Chrome Ext Dev Doc",
        "addr": "https://developer.chrome.com/docs/extensions/reference/",
        "action": "https://developer.chrome.com/docs/extensions/reference/",
        "ajax": ".search-box__input"
    },

    "label_many": { "lstr": "Many Engines at once" },
    "many_once" : {
        "dname": "Many Engines at once",
        "btns": {
            "gg_ddg": {
                "label": "Google + DDG",
                "use_other_engine": ["google", "duckduckgo"]
            }
        }
    }
}

Specification of Editing Engines Data and Special Search Methods

Specifications

In JSON format.

Engine data in full format can contain following key-values (special search methods included):

Specifications
// # Some key-value ​​in the button can override the key-value in the engine name
{
    "engine_name": {
        "dname": "Engine display name",
        "addr": "Homepage URL",  // # optional
        "tip": "Engine tip text", // # optional
        
        "action": "form action url",
        // # For example, https://search-engine.com/search?q=input_content,
        // # The action is https://search-engine.com/search
        "kw_key": "The key name of the keyword in the query string", // # In above example, it is q
        
        "full_url": "http://www.example.com/search/{0}", // # optional. Only when GET method. Will override above two. The entire url 
        
        "method": "get/post", // # optional. default is get
        
        "charset": "UTF-8/gb2312/gb18030/big5/iso-xxxx....", // # optional. default UTF-8
        
        "allow_referer": false, // # false(default)/true optional
        
        "kw_replace": [[" ", "-"]], // # Optional, characters that need to be replaced in the search term. In this example, replace spaces with '-'
        "kw_format": "formatted string with {0}", // # optional. {0} is like %s

        "params":[ // # Optional, the key/value other than the keyword in the query string required for this operation. POST method may need
            {"key": "key", "val": "value"},
            // # For example, https://search-engine.com/search?q=input_content&option=searchall
            // # so {key: "option", val: "searchall"},
        ],
        
        "use_other_engine": {   // # optional, use another engine to do the operation.
            "dbname": "bigsearch/user/browser",   // # Optional. Where the engines database come from (3 available databases): BigSearch build-in database (default) / User custom database / Browser-installed database
            "engine": "engine name", 
            "btn": "button name"   // # Optional. Absence will make fallback to the first button
            // # this entire object can be simplified to an engine name
        },
        // #  (if use array here, then do many operations at once)
        
        "ajax": ......  // # Optional. Read the Ajax-render websites instructions
            
        "btns": { // # optional. If there is no such item, a "Search" button is displayed, and clicking the button will do the default action
            "Button name": {
                "label": "Button display text",
                "btn_tip": "Tip text", // # optional
                
                "..." : "..." // # here in a btn can be key-value pairs, which will override those in engine
            },
            ....
        }
    },
}

Instructions for searching Ajax-render websites

Some websites doesn't accept GET or POST. Visitor need to open their page then input, they then show results via Ajax.

Big Search can deal with such Ajax-render websites. And easy to configure:

Ajax-render websites instructions

Eg 1: Specify the querySelector of input box. It will automatically input search term and trigger pressing Enter event.

"ajax": "#search-box-input"

Eg 2: Delay 2s -> Input -> Delay 1s -> Trigger clicking button event

"ajax": [2000, "#search-box-input", 1000, "#submit-button"]

For Developers

We encourage user to submit their customized search engines data to source code after they format as JSON (submit to file enginesdata.js). Search engines data is AGPL licensed FLOSS.

What's Next Step

This tool still can be improved to do something more:

  • Improve the online editing-engine GUI
  • Omnibox
  • Choose a fast & lightweight framework (any ideas)
  • Browser (native) sidebar panel (before that need to change UI. Need responsive)
  • Desktop stanalone app, opening URL with user-assigned browser
  • Mobile native app (any idea?)
  • Be compatible with others e.g. OpenSearch. Add or convert by 1-click
  • Be able to be used via CLI in terminal (nodejs)

Technical Diagram

tech_diagram

Third-party libraries and components used

Fast and lightweight: NO heavy framework or library dependencies. Although it has UI themes of both simplicify & fancy, all main features and UI are pure JS + CSS.

  • LZ-UTF8.js (81kB not minified. Data compression library, only for user-custom engines sync)

    Copyright (c) 2021, Rotem Dan
    Released under the MIT license.
    
  • Foggy Lake (37kB webp. Default background photo)

    by Quang Nguyen Vinh

  • Unicons icon (svg)

    Unicons by Iconscout

Globalization

Because there are currently only 2 languages supported, no framework used yet, only a simple function to implement multi-language.

For strings that you want it to be multi-language (it's okay to leave it English only, also), use JS function i18n(), whose input parameters can be:

  • An array of strings (for only Chinese and English 2 languages). [0] is Chinese, [1] is English
  • An Object like {zh: "This is Chinese, en: "This is English", fr: "This is French"}

It will return a string of the corresponding language

If you want to add a search engine that only targets users in a certain language, you can use visible_lang to make it visible only to a certain language.

History, Code Status, and License

A part of the code of this tool can be traced back to around 2008. Web app published to be usable to the public on Internet in 2015. Not until early 2020s, I found webExtension and JS standarized, so made this tool a browser extension and setup a Github repo for it. (Yes it's developed slowly and gently, not full-time.)

Some code has been ever (and may still getting) refactored. Although there's still some some aged parts, this tool has always been modern, handy & useful.

Have given the engines data enginesdata.js AGPL FLOSS license (so welcome adding data 🌱. Or, if you know any license properer for this data 🍀). Feel free to discuss (open an issue) if want FLOSS license for this whole project 💚.

Change log

bigsearch's People

Contributors

garywill avatar gitoffthelawn avatar

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.