Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flipkart Smart Filters (Firefox extension)

Adds two things Flipkart's own site doesn't give you:

  1. Auto-hides out-of-stock products on search/category pages.
  2. Extra filters — minimum rating, minimum discount %, and a price range — applied on top of whatever you've already searched/filtered on Flipkart itself.

How to load it in Firefox (temporary, for development/testing)

  1. Unzip this folder somewhere on disk.
  2. Open Firefox and go to about:debugging#/runtime/this-firefox.
  3. Click Load Temporary Add-on….
  4. Select the manifest.json file inside this folder.
  5. Go to flipkart.com, search for something — a small ⚡ Smart Filters panel appears in the top-right corner of the page.

Note: "temporary" add-ons are removed when Firefox restarts. To keep it permanently without submitting to addons.mozilla.org, you'd need to sign it via Mozilla's web-ext self-distribution flow, or just reload it each session via about:debugging.

How it works

  • content.js runs on every Flipkart page. It finds product cards by looking for product-detail links (/p/...) combined with a price nearby — not by hardcoded CSS classes, since Flipkart's class names are obfuscated and change often. This makes it more resilient, but not bulletproof.
  • A MutationObserver re-applies filters whenever new products load (infinite scroll, pagination via AJAX, etc.).
  • Settings (hide-OOS toggle, rating/discount/price thresholds) are saved via browser.storage.local, so they persist across page loads and are also editable from the toolbar popup.

Known limitations / things to tweak

  • Out-of-stock detection relies on text like "Out of Stock", "Sold Out", "Currently unavailable" appearing in the card. If Flipkart uses a different phrase or an image-based badge with no text, it won't be caught — let me know what you see and I can add a pattern.
  • Rating/discount extraction uses regex heuristics on the card's visible text (e.g. a lone number 1–5 for rating, "NN% off" for discount). Occasionally a card with no rating shown will just be treated as "unknown" and kept visible rather than hidden — that's intentional so real listings aren't hidden by mistake.
  • Card boundary detection (where one product's info ends and the next begins) is heuristic. If you notice two products' info getting merged into one "card" (so filtering one hides both), tell me and I'll tighten the boundary logic.
  • Manifest V3 background/service worker isn't used here since there's no need for one yet — everything runs in the content script + popup.

Extending it

Easy things to add on request:

  • Filter by seller/brand keyword
  • Filter by delivery time ("Get it by...")
  • Sort cards by discount or rating (not just show/hide)
  • A count badge showing how many items got filtered vs. total
  • Keyboard shortcut to toggle the panel

About

mockup extension for flipkart

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages