Skip to content

Commit ab09226

Browse files
committed
Added check cursor pos vs. Settings crown pos to modals.handlers.dismiss.click() (fixes adamlui/ai-web-extensions#249) ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/amazongpt]
1 parent a074f68 commit ab09226

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.10.20.1
6+
// @version 2025.10.20.2
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -1344,7 +1344,14 @@
13441344

13451345
dismiss: { // to dismiss native modals
13461346
click(event) {
1347-
const clickedElem = event.target
1347+
const clickedElem = event.target,
1348+
settingsCrown = document.querySelector(`#${app.slug}-settings > img`)
1349+
if (settingsCrown) { // return if cursor within bounds
1350+
const crownRect = settingsCrown.getBoundingClientRect()
1351+
if (event.clientX >= crownRect.left && event.clientX <= crownRect.right
1352+
&& event.clientY >= crownRect.top && event.clientY <= crownRect.bottom
1353+
) return
1354+
}
13481355
if (clickedElem == event.currentTarget || clickedElem.closest('[class*=-close-btn]'))
13491356
modals.hide((clickedElem.closest('[class*=-modal-bg]') || clickedElem).firstChild)
13501357
},

0 commit comments

Comments
 (0)