Skip to content

Commit 024f772

Browse files
committed
Converted env.browser.isPhone to .isCompact ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/amazongpt]
1 parent 8a42ee0 commit 024f772

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 8 additions & 8 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.21.1
6+
// @version 2025.10.21.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
@@ -141,7 +141,7 @@
141141
env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
142142
Object.assign(env.browser, {
143143
get isPortrait() { return env.browser.isMobile && (innerWidth < innerHeight) },
144-
get isPhone() { return env.browser.isMobile && innerWidth <= 480 }
144+
get isCompact() { return innerWidth <= 480 }
145145
})
146146
env.scriptManager.supportsStreaming = /Tampermonkey|ScriptCat/.test(env.scriptManager.name)
147147
env.scriptManager.supportsTooltips = env.scriptManager.name == 'Tampermonkey'
@@ -403,7 +403,7 @@
403403
color: #b6b8ba ; fill: #b6b8ba ; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite }
404404
#${app.slug} section.loading { padding-left: 5px } /* left-pad loading status when sending replies */
405405
#${app.slug}-font-size-slider-track {
406-
width: 98% ; height: 7px ; margin: -2px auto ${ env.browser.isPhone ? -8 : -13 }px ;
406+
width: 98% ; height: 7px ; margin: -2px auto ${ env.browser.isCompact ? -8 : -13 }px ;
407407
padding: 15px 0 ; background-color: #ccc ; box-sizing: content-box; background-clip: content-box ;
408408
-webkit-background-clip: content-box }
409409
#${app.slug}-font-size-slider-track::before { /* to add finger cursor to unpadded core only */
@@ -590,7 +590,7 @@
590590
},
591591

592592
bylineVisibility() {
593-
if (env.browser.isPhone) return // since byline hidden by app.styles
593+
if (env.browser.isCompact) return // since byline hidden by app.styles
594594

595595
// Init header elems
596596
const headerElems = { byline: app.div.querySelector('.byline') }
@@ -1268,7 +1268,7 @@
12681268
aboutModal.querySelector('h2').remove() // remove empty title h2
12691269
aboutModal.querySelector('p').style.cssText = `
12701270
overflow-wrap: anywhere ; line-height: 1.55 ;
1271-
margin: ${ env.browser.isPhone ? '6px 0 -16px' : '0 0 0 21px' }`
1271+
margin: ${ env.browser.isCompact ? '6px 0 -16px' : '0 0 0 21px' }`
12721272

12731273
// Hack buttons
12741274
aboutModal.querySelectorAll('button').forEach(btn => {
@@ -1330,7 +1330,7 @@
13301330
// Re-style elems
13311331
apiModal.querySelector('h2').style.justifySelf = 'center' // center title
13321332
const btnsDiv = apiModal.querySelector('.modal-buttons')
1333-
btnsDiv.style.cssText = `margin: 0 !important ; ${ env.browser.isPhone ? ''
1333+
btnsDiv.style.cssText = `margin: 0 !important ; ${ env.browser.isCompact ? ''
13341334
: 'flex-wrap: wrap ; justify-content: center ; gap: 9px' }` // gridify wide view btns
13351335
btnsDiv.querySelectorAll('button').forEach((btn, idx) => {
13361336
if (idx == 0) btn.style.display = 'none' // hide Dismiss button
@@ -1844,7 +1844,7 @@
18441844
}
18451845
.chatgpt-modal > div {
18461846
background-color: white !important ; color: black ;
1847-
padding: ${ env.browser.isPhone ? '22px' : '20px 30px 24px 17px' }!important
1847+
padding: ${ env.browser.isCompact ? '22px' : '20px 30px 24px 17px' }!important
18481848
}
18491849
.chatgpt-modal p { margin: -8px 0 -14px 4px ; font-size: 22px ; line-height: 31px }
18501850
.chatgpt-modal a { color: #${ appScheme == 'dark' ? '00cfff' : '1e9ebb' } !important }
@@ -1930,7 +1930,7 @@
19301930
align-content: center ; /* for symmetrized gaps when odd num of entries */
19311931
list-style: none ; padding: 0 ; margin: 0 0 2px -3px ; /* hide bullets, close bottom gap */
19321932
width: ${ env.browser.isPortrait ? 100 : 50 }% } /* set width based on column cnt */
1933-
${ env.browser.isPhone ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
1933+
${ env.browser.isCompact ? '' : `#${app.slug}-settings ul:first-of-type { /* color desktop middle sep */
19341934
border-right: 1px dotted ${ appScheme == 'dark' ? 'white' : 'black' }}`}
19351935
#${app.slug}-settings li {
19361936
color: ${ appScheme == 'dark' ? 'rgb(255,255,255,0.65)' : 'rgba(0,0,0,0.45)' };

0 commit comments

Comments
 (0)