Skip to content

kuanyui/EngineSwitcher

Repository files navigation

Engine Switcher

A WebExtension to switch current page between various search engines in just one click (or Ctrl+Alt+N), if you are too lazy to type !b, !g (especially on mobile) in DuckDuckGo.

So you can easily keep your privacy as possible as you can.

Currently supported search engines:

Private-focused

  • DuckDuckGo
  • Ecosia
  • Brave
  • Gibiru
  • MetaGer (en / de)
  • You.com

Unknown

  • Yahoo OneSearch
  • StartPage
  • Wikipedia English (Unrecommended)

Commercial

  • Bing
  • Google
  • goo
  • Yahoo! JAPAN
  • Yahoo!
  • Yandex (en / ru)

For more information please see GitHub.

Install

Screenshot

https://addons.mozilla.org/user-media/previews/full/268/268699.png https://addons.mozilla.org/user-media/previews/full/268/268700.png

Supported Browser

  • Firefox for Desktop >= 61
  • Firefox for Android >= 61

Requirements for Development

  • Node
  • web-ext
  • GNU Make
  • Python 3 (For HTTP server)

Development

Prepare

npm i

Run for development (Watch)

make watch
web-ext run --verbose --firefox-profile ~/.mozilla/firefox/PROFILE_DIR_NAME

If webpack watch exit immediately without any error, please try https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

Run Firefox for developing WebExtension

web-ext run --verbose --firefox-profile ~/.mozilla/firefox/XXXXXXX.NAME

Deploy (Build .xpi file & run a HTTP server for download)

make xpi-server

Zip this repository for uploading to addons.mozilla.org

make zip-repo

Permission

For paranoid users such as me, these are all used permissions with its usages:

  • tabs:
    • Watch the URL changing of all tabs, for checking if URL is supported stie, and decide if show / hide pageAction button. (browser.tabs.onUpdated).
    • Get the URL of current page (Tab.url in pageAction.onClicked)
    • Redirect to new URL (tabs.update({url: string}))

    Firefox for Android requires developer call browser.pageAction.show() explicitly and it’s impossible to use pageAction with only manifest.page_action.show_matches to implement this extension.

  • storage:
    • For saving user preferences in your Mozilla account (storage.sync)
  • startpage.com
    • startpage.com protect privacy in a extremely paranoid way: it’s impossible to get query string from URL. Therefore, I have to inserting content.js to get query string from <input>.

Acknowedgement

  • Main icon is from Breeze of KDE Project

TODOs

  • Customizable keyboard shortcuts.
  • More search engines.
  • Buttons for Fenix

License

WTFPL 2.0