Skip to content

warren-bank/crx-faux-searchbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Summary:

Chromium browser extension:

  • provides the ability to easily:
    • describe custom search engines
      • specifically, any endpoint that can accept GET or POST requests and returns a complete HTML document
    • select an engine
    • run a query
  • all data is self-contained
    • can be export and reimport in JSON format
    • does not integrate with any Chrome settings, such as:
      • custom search engines
      • bookmarks
      • history
      • etc..
    • uses the data stores:

Notes:

  • many of the more advanced/technical options can only be edited in JSON
    • the easiest workflow is: export, edit, clear all search engines, import
  • format of JSON data:
{
    "restore": "append",
    "searchengines": [{shortname, iconurl, searchurl, method, encoding, position, isdefault}]
}
  • fields:
    • restore:
      • "append"
        • import appends new data to existing
      • any other value:
        • import deletes and replaces existing data
    • searchengines:
      • array of individual search engines
      • individual search engines:
        • shortname:
          • String: descriptive name that appears in dropdown list
        • iconurl:
          • String: URL for the icon that appears in dropdown list
        • searchurl:
          • String: URL to open when the search engine is chosen from dropdown list
            • the substring "{searchTerms}" is interpolated with the (url-encoded) value entered in the text search field
        • method:
          • String: "get" or "post"
        • encoding:
          • String: modifies url-encoding of the text search field
            • "other":
              • whitespace is replaced by: "%20"
            • all other values:
              • whitespace is replaced by: "+"
        • position:
          • Number: modifies sort order
            • position ASC, shortname ASC
              • 1st: search engines are sorted by position
              • 2nd: within each group of search engines that share the same position, they are sub-sorted by shortname
        • isdefault:
          • Number (representing a boolean):
            • 1:
              • can only be set to true for one single search engine in array
              • causes the chosen search engine to be selected by default when the searchbar page is opened
            • 0:
              • otherwise
  • when searchurl does not contain the substring "{searchTerms}":
    • searchurl is a static bookmark
      • the value entered in the text search field is ignored
    • searchurl is opened as soon as the search engine is chosen from dropdown list
  • when the dropdown list is toggled open:
    • its contents will be dynamically filtered by the value entered in the text search field
      • case is ignored
      • special filters:
        • "*":
          • only display search engines that utilize: "{searchTerms}"
        • "!*":
          • only display static bookmarks that do not utilize: "{searchTerms}"
    • to see an unfiltered list of all available search engines, clear the value entered in the text search field

Fork:

This extension is a fork of Fauxbar

This extension was started with the intention to be a strict subset of the original. It stripped away many of its predecessor's features and functionalities.

  • the original is a powerful alternative to the Chrome omnibox
    • it integrates itself tightly with many Chrome settings (ex: bookmarks, history)
    • it maintains a database copy of each of these settings, and uses APIs to be notified of changes so it can keep its database in sync
    • it provides the ability to sync this data to "the cloud"
  • in addition, the original includes a search bar that does not integrate with Chrome's custom search engine settings
    • the data only exists in its database
  • the purpose of this extension was to carve out only this search bar, and remove all the rest

The initial release of this extension met this goal. It has since added a few bells & whistles of its own.

Incognito Limitations:

These limitations are inherited from the design of the original extension:

  • cannot open the extension's search page in an incognito window
    • would need to add "incognito": "split" to manifest.json
  • cannot directly access the database from a user-script in an incognito window
    • would need to migrate all code that touches the database to the background script
    • would need to update the user-script to run this code via the background script
    • this wouldn't work with "incognito": "split" since:
      • the background script that can be accessed by user-scripts in an incognito window cannot directly access the database

Incognito Workaround:

added in v0.2.0:

  • Options > General > Query:
    • Upon submitting a search query, open the results: in an incognito window
    • pro:
      • displays search results in an incognito window
    • con:
      • the search bar must still be loaded into a non-incognito window
    • caveats:
      • "Allow in incognito" must be true
        • not used for loading the search bar, but needed to access incognito windowId values used by the tabs API
      • new incognito tabs are initialized to an "http:" URL, since extensions cannot access "chrome://newtab/"
        • explains why the new tab might momentarily display a small icon

Credits:

Legal:

About

A tool to easily describe and query custom search engines.

Resources

License

Stars

Watchers

Forks

Packages

No packages published