// will work for ebay but amazon doesn't have country of origin.
const filterKeywords = [
"india", "indian", "bharat", "delhi", "new delhi", "mumbai", "bombay", "bangalore", "bengaluru",
"chennai", "madras", "kolkata", "calcutta", "hyderabad", "ahmedabad", "surat", "pune", "jaipur",
"gujarat", "maharashtra", "karnataka", "tamil nadu", "west bengal", "punjab", "haryana",
"pakistan", "pakistani", "karachi", "lahore", "islamabad", "faisalabad", "rawalpindi", "sialkot",
"bangladesh", "bangladeshi", "dhaka", "chittagong", "chattogram", "khulna", "sylhet",
"sri lanka", "srilanka", "ceylon", "colombo", "kandy", "galle", "nepal", "nepalese", "kathmandu", "pokhara"
];
// ai says these are common sellers.
const blockedSellers = [
"cocoblu retail",
"rk world infocom",
"etrade online",
"clicktech retail",
"retailez",
"kay kay overseas",
"dawntech electronics",
"ibell power tools",
"campus activewear",
"honasa consumer",
"mamaearth",
"jaspo sporting",
"xech technologies"
];
//will need to add other shopping sites to list, like ebay that should be easier to filter by country.
function processGrid() {
const productCards = document.querySelectorAll('[data-component-type="s-search-result"]');
productCards.forEach(card => {
if (card.style.display === 'none') return;
const cardText = card.innerText.toLowerCase();
const matchesRegion = filterKeywords.some(keyword => cardText.includes(keyword));
const matchesSeller = blockedSellers.some(seller => cardText.includes(seller));
if (matchesRegion || matchesSeller) {
card.style.display = 'none';
const titleElement = card.querySelector('h2 a a-size-base-plus, h2 a span');
const itemTitle = titleElement ? titleElement.innerText.trim() : "Unknown Title";
const triggerReason = matchesSeller ? "Corporate Entity Match" : "Regional Keyword Match";
console.warn(`[FILTERED] Removed: "${itemTitle}" Reason: [${triggerReason}]`);
}
});
}
// Run immediately upon initial page layout load
processGrid();
// copied from somewhere but does at least check each item
const observer = new MutationObserver((mutations) => {
for (let mutation of mutations) {
if (mutation.addedNodes.length) {
processGrid();
break;
}
}
});
const searchContainer = document.querySelector('.s-desktop-content') || document.body;
observer.observe(searchContainer, { childList: true, subtree: true });