Skip to content

Commit c9d1a79

Browse files
committed
Condensed ensure ChatGPT Projects scroll
1 parent 3cd100e commit c9d1a79

File tree

3 files changed

+37
-50
lines changed

3 files changed

+37
-50
lines changed

chatgpt-widescreen/chromium/extension/content.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,19 @@
284284
notify(browserAPI.getMsg('notif_chatStopped'), 'bottom-right')) } catch (err) {}
285285
})
286286

287-
// === FIX: Keep Projects landing list scrollable (issue #192) ===
288-
function ensureProjectsScroll() {
289-
if (env.site !== 'chatgpt') return
290-
const el = document.querySelector(
291-
'div[role="presentation"] > header#page-header + div.flex.basis-auto.flex-col.grow'
292-
)
293-
if (el) {
294-
el.style.overflowY = 'auto'
295-
el.style.maxHeight = '100vh' // safety cap
296-
el.style.overscrollBehavior = 'contain' // smoother wheel/touch behaviour
287+
// Ensure CHATGPT PROJECTS scroll
288+
if (env.site == 'chatgpt') {
289+
ensureProjectsScroll()
290+
new MutationObserver(ensureProjectsScroll).observe(document.body, { childList: true, subtree: true })
291+
function ensureProjectsScroll() {
292+
const projectElem = document.querySelector(
293+
'div[role="presentation"] > header#page-header + div.flex.basis-auto.flex-col.grow')
294+
if (projectElem) {
295+
projectElem.style.overflowY = 'auto'
296+
projectElem.style.maxHeight = '100vh' // safety cap
297+
projectElem.style.overscrollBehavior = 'contain' // smoother wheel/touch behaviour
298+
}
297299
}
298300
}
299-
ensureProjectsScroll()
300-
new MutationObserver(ensureProjectsScroll).observe(document.body, {
301-
childList: true,
302-
subtree: true
303-
})
304-
// === END FIX ===
305301

306302
})()

chatgpt-widescreen/firefox/extension/content.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,24 +284,19 @@
284284
notify(browserAPI.getMsg('notif_chatStopped'), 'bottom-right')) } catch (err) {}
285285
})
286286

287-
// === FIX: Keep Projects landing list scrollable (issue #192) ===
288-
function ensureProjectsScroll() {
289-
if (env.site !== 'chatgpt') return
290-
const el = document.querySelector(
291-
'div[role="presentation"] > header#page-header + div.flex.basis-auto.flex-col.grow'
292-
)
293-
if (el) {
294-
el.style.overflowY = 'auto' // allow vertical scrolling
295-
el.style.maxHeight = '100vh' // safety cap
296-
el.style.overscrollBehavior = 'contain' // smoother wheel/touch behaviour
287+
// Ensure CHATGPT PROJECTS scroll
288+
if (env.site == 'chatgpt') {
289+
ensureProjectsScroll()
290+
new MutationObserver(ensureProjectsScroll).observe(document.body, { childList: true, subtree: true })
291+
function ensureProjectsScroll() {
292+
const projectElem = document.querySelector(
293+
'div[role="presentation"] > header#page-header + div.flex.basis-auto.flex-col.grow')
294+
if (projectElem) {
295+
projectElem.style.overflowY = 'auto'
296+
projectElem.style.maxHeight = '100vh' // safety cap
297+
projectElem.style.overscrollBehavior = 'contain' // smoother wheel/touch behaviour
298+
}
297299
}
298300
}
299-
// Run once and re-apply on dynamic DOM changes
300-
ensureProjectsScroll()
301-
new MutationObserver(ensureProjectsScroll).observe(document.body, {
302-
childList: true,
303-
subtree: true
304-
})
305-
// === END FIX ===
306301

307302
})()

chatgpt-widescreen/greasemonkey/chatgpt-widescreen-mode.user.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
// @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-poe.com!
236236
// @author Adam Lui
237237
// @namespace https://github.com/adamlui
238-
// @version 2025.8.11
238+
// @version 2025.8.12
239239
// @license MIT
240240
// @icon https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?v=844b16e
241241
// @icon64 https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?v=844b16e
@@ -827,23 +827,19 @@
827827
notify(app.msgs.notif_chatStopped, 'bottom-right')) } catch (err) {}
828828
})
829829

830-
// === FIX: Keep Projects landing list scrollable (issue #192) ===
831-
function ensureProjectsScroll() {
832-
if (env.site !== 'chatgpt') return
833-
const el = document.querySelector(
834-
'div[role="presentation"] > header#page-header + div.flex.basis-auto.flex-col.grow'
835-
)
836-
if (el) {
837-
el.style.overflowY = 'auto' // allow vertical scrolling
838-
el.style.maxHeight = '100vh' // safety cap
839-
el.style.overscrollBehavior = 'contain' // smoother wheel/touch behaviour
830+
// Ensure CHATGPT PROJECTS scroll
831+
if (env.site == 'chatgpt') {
832+
ensureProjectsScroll()
833+
new MutationObserver(ensureProjectsScroll).observe(document.body, { childList: true, subtree: true })
834+
function ensureProjectsScroll() {
835+
const projectElem = document.querySelector(
836+
'div[role="presentation"] > header#page-header + div.flex.basis-auto.flex-col.grow')
837+
if (projectElem) {
838+
projectElem.style.overflowY = 'auto'
839+
projectElem.style.maxHeight = '100vh' // safety cap
840+
projectElem.style.overscrollBehavior = 'contain' // smoother wheel/touch behaviour
841+
}
840842
}
841843
}
842-
ensureProjectsScroll()
843-
new MutationObserver(ensureProjectsScroll).observe(document.body, {
844-
childList: true,
845-
subtree: true
846-
})
847-
// === END FIX ===
848844

849845
})()

0 commit comments

Comments
 (0)