Skip to content

Latest commit

 

History

History
103 lines (72 loc) · 2.99 KB

File metadata and controls

103 lines (72 loc) · 2.99 KB

Amazon Search Focus icon

Amazon Search Focus (Firefox extension)

A lightweight Firefox extension that automatically focuses the Amazon search field when you land on a supported Amazon homepage.

This is intended as a fast, privacy-friendly workflow: minimal UI, no backend, and no data sent anywhere.

Features

  • Automatically focuses the search field on supported Amazon homepage URLs
  • Popup toggle to turn auto-focus ON/OFF without disabling the extension
  • Does not auto-focus on product pages or other non-homepage routes
  • Press Escape while the search field is focused to blur it
  • Avoids stealing focus if you are already interacting with another input
  • Retries briefly after page load because Amazon often renders the header late

What it does

When you open a supported Amazon homepage, the extension:

  1. Waits for the page header and search input to appear
  2. Focuses the search field if nothing else is already focused
  3. Lets you dismiss focus by pressing Escape

This means you can start typing immediately without clicking into the search box first.

Toggle on/off from the extension popup

  • Click the extension toolbar button to open the popup
  • Use the toggle switch to set the feature to ON or OFF
  • The state is saved and applied across tabs/sessions
  • The button badge shows current state (ON or OFF)

Installation (temporary, for development)

  1. Open Firefox
  2. Go to:
about:debugging#/runtime/this-firefox
  1. Click Load Temporary Add-on...
  2. Select the manifest.json file in this project

Open a supported Amazon homepage and the search field will be focused automatically.

How it works (high level)

The content script:

  1. Runs on the supported Amazon domains listed in the manifest
  2. Checks whether the current page is a root storefront URL such as / or /ref=...
  3. Looks for Amazon's search input in the page header
  4. Focuses it only if another meaningful element is not already focused
  5. Listens for Escape so the focused search field can be blurred quickly

All processing happens locally in the browser.

Limitations

  • It only runs on the supported www.amazon.* domains listed in the manifest
  • Amazon frequently changes its DOM and header structure
  • Some locale or layout changes may require selector updates in the content script

When Amazon changes its layout, selectors or homepage heuristics may need updating.

Supported browser

  • Firefox

Building

web-ext lint --source-dir .
web-ext build --source-dir . --overwrite-dest

The build output is generated at web-ext-artifacts/amazon_search_focus-1.0.3.zip.

Folder structure

Amazon-Search-Focus/
├─ manifest.json
├─ background.js
├─ content-script.js
├─ popup.html
├─ popup.css
├─ popup.js
├─ icon.png
├─ icon-48.png
├─ icon-96.png
├─ icon-128.png
├─ LICENSE
└─ README.md

License

This project is released under the Unlicense. See LICENSE.