diff --git a/src/helpers/knowledge/db.json b/src/helpers/knowledge/db.json index f8b9604..f53ecd1 100644 --- a/src/helpers/knowledge/db.json +++ b/src/helpers/knowledge/db.json @@ -64,5 +64,27 @@ } } ] + }, + "amazon.com": { + "rules": [ + { + "regexes": [".*"], + "knowledge": { + "notes": [ + "Be careful not to confuse the \"Add to Cart\" with the \"Buy Now\". The \"Add to Cart\" button adds the item to the cart, while the \"Buy Now\" button takes you to the checkout page.", + "Do not confuse \"Buy Now\" and \"Buy New\" on product page.", + "You should always verify if the product is in stock before buying or adding to the cart. If the product is not in stock, you should notify the user about it." + ] + } + }, + { + "regexes": ["^/s$"], + "knowledge": { + "notes": [ + "There is no \"Add to Cart\" button on the search results page. You need to click on the product name to go to the product details page first." + ] + } + } + ] } } diff --git a/src/helpers/knowledge/redirects.json b/src/helpers/knowledge/redirects.json index 1bb5f2b..266022a 100644 --- a/src/helpers/knowledge/redirects.json +++ b/src/helpers/knowledge/redirects.json @@ -2,5 +2,6 @@ "twitter.com": "x.com", "www.twitter.com": "x.com", "www.x.com": "x.com", - "www.airbnb.com": "airbnb.com" + "www.airbnb.com": "airbnb.com", + "www.amazon.com": "amazon.com" } diff --git a/src/pages/content/drawLabels.ts b/src/pages/content/drawLabels.ts index fb394e1..d3a0699 100644 --- a/src/pages/content/drawLabels.ts +++ b/src/pages/content/drawLabels.ts @@ -68,8 +68,8 @@ function isVisible( const { display, visibility, opacity } = style; if (display === "none") return false; if (visibility !== "visible") return false; - if (opacity != null && parseFloat(opacity) < 0.1) return false; // considering something very close to 0 as invisible - // don't respect 'aria-hidden' attribute since they are most likely visible to the user + if (opacity != null && parseFloat(opacity) <= 0) return false; + // don't respect 'aria-hidden' attribute since they are most likely visible in the screenshot // if (element.getAttribute('aria-hidden') === 'true') return false; const rect = element.getBoundingClientRect(); diff --git a/src/pages/content/style.global.scss b/src/pages/content/style.global.scss index 6de434e..aae2cf5 100644 --- a/src/pages/content/style.global.scss +++ b/src/pages/content/style.global.scss @@ -8,7 +8,7 @@ animation: web-agent-ripple 0.5s ease-out; background-color: rgba(0, 0, 255, 0.961); pointer-events: none; - z-index: 9999; + z-index: 999999; } @keyframes web-agent-ripple {